Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 8 pull requests #135234

Merged
merged 22 commits into from
Jan 8, 2025
Merged

Rollup of 8 pull requests #135234

merged 22 commits into from
Jan 8, 2025

Conversation

jhpratt
Copy link
Member

@jhpratt jhpratt commented Jan 8, 2025

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

surban and others added 22 commits December 18, 2024 11:33
This always falls back to sleeping since there is no way
to notify a condvar on a target without threads.
it's still partially a skeleton, but works well enough for almost all tests to pass
this is to remove the entire `util` module
it's been simplified over the years, but now it's no longer useful.

- document its replacement in `BorrowKind`
- use that everywhere instead
push constraint creation to where the statement/terminator info is gathered
Impl String::into_chars

Tracking issue - rust-lang#133125

r? `@programmerjake` `@kennytm` `@Amanieu`

This refers to rust-lang/libs-team#268

Before adding tests and creating a tracking issue, I'd like to reach a consensus on the implementation direction and two questions:

1. Whether we'd add a `String::into_char_indices` method also?
2. See inline comment.
…r=m-ou-se

Condvar: implement wait_timeout for targets without threads

This always falls back to sleeping since there is no way to notify a condvar on a target without threads.

Even on a target that has no threads the following code is a legitimate use case:

```rust
use std::sync::{Condvar, Mutex};
use std::time::Duration;

fn main() {
    let cv = Condvar::new();
    let mutex = Mutex::new(());
    let mut guard = mutex.lock().unwrap();

    cv.notify_one();

    let res;
    (guard, res) = cv.wait_timeout(guard, Duration::from_secs(3)).unwrap();
    assert!(res.timed_out());
}
```
…kh726

Convert typeck constraints in location-sensitive polonius

In this PR, we do a big chunk of the work of localizing regular outlives constraints.

The slightly annoying thing is handling effectful statements: usually the subset graph propagates loans at a single point between regions, and liveness propagates loans between points within a single region, but some statements have effects applied on exit.

This was also a problem before, in datalog polonius terms and Niko's solution at the time, this is about: the mid-point. The idea was to duplicate all MIR locations into two physical points, and orchestrate the effects with that. Somewhat easier to do, but double the CFG.

We've always believed we didn't _need_ midpoints in principle, as we can represent changes on exit as on happening entry to the successor, but there's some difficulty in tracking the position information at sufficient granularity through outlives relation (especially since we also have bidirectional edges and time-traveling now).

Now, that is surely what we should be doing in the future. In the mean time, I infer this from the kind of statement/terminator where an outlives constraint arose. It's not particularly complicated but some explanation will help clarify the code.

Assignments (in their various forms) are the quintessential example of these crossover cases: loans that would flow into the LHS would not be visible on entry to the point but on exit -- so we'll localize these edges to the successor. Let's look at a real-world example, involving invariance for bidirectional edges:

```rust
let mut _1: HashMap<i32, &'7 i32>;
let mut _3: &'9 mut HashMap<i32, &'10 i32>;
...
/* at bb1[3]: */ _3 = &'3 mut _1;
```

Here, typeck expectedly produces 3 outlives constraints today:
1. `'3 -> '9`
2. `'7 -> '10`
3. `'10 -> '7`

And we localize them like so,

1. `'3 -> '9` flows into the LHS and becomes: `3_bb1_3 -> 9_bb1_4`
2. `'7 -> '10` flows into the LHS and becomes: `7_bb1_3 -> 10_bb1_4`
3. `'10 -> '7` flows from the LHS and becomes: `10_bb1_4 -> 7_bb1_3` (time traveling 👌)

---

r? ``@jackh726``

To keep you entertained during the holidays I also threw in a couple of small changes removing cruft in the borrow checker.

We're actually getting there. The next PR will be the last one needed to get end-to-end tests working.
…r=cuviper

triagebot: register `relnotes-interest-group` ping group

Part of rust-lang#133334.
rust-lang/team#1613 merged.
cc T-release discussions in https://rust-lang.zulipchat.com/#narrow/channel/241545-t-release/topic/Please.20CC.20lang

r? release
More compelling env_clear() examples

`ls` isn't a command that people usually set env vars for, and `PATH` in particular isn't even used by `ls`.
…ingjubilee

Reserve x18 register for aarch64 wrs vxworks target

Fixes rust-lang#135166
r? ``@workingjubilee``

Regards,
B I Abbas
…jubilee

arm: add unstable soft-float target feature

This has an actual usecase as mentioned [here](rust-lang#116344 (comment)), and with my recent ARM float ABI changes there shouldn't be any soundness concerns any more. We will reject enabling this feature on `hf` targets, but disabling it on non-`hf` targets is entirely fine -- the target feature refers to whether softfloat emulation is used for float instructions, and is independent of the ABI which we set separately via `llvm_floatabi`.

Cc ``@workingjubilee``
…rrors

warn about broken simd not only on structs but also enums and unions when we didn't opt in to it

addresses rust-lang#135208 (comment)

r? ``@Noratrieb``
@rustbot rustbot added A-meta Area: Issues & PRs about the rust-lang/rust repository itself S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Jan 8, 2025
@jhpratt
Copy link
Member Author

jhpratt commented Jan 8, 2025

@bors r+ rollup=never p=5

@bors
Copy link
Contributor

bors commented Jan 8, 2025

📌 Commit 485fae5 has been approved by jhpratt

It is now in the queue for this repository.

@bors bors removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 8, 2025
@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Jan 8, 2025
@bors
Copy link
Contributor

bors commented Jan 8, 2025

⌛ Testing commit 485fae5 with merge 9c87288...

@bors
Copy link
Contributor

bors commented Jan 8, 2025

☀️ Test successful - checks-actions
Approved by: jhpratt
Pushing 9c87288 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jan 8, 2025
@bors bors merged commit 9c87288 into rust-lang:master Jan 8, 2025
7 checks passed
@rustbot rustbot added this to the 1.86.0 milestone Jan 8, 2025
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#133057 Impl String::into_chars 69e98c66ea095de3dd416348530f08bbe53277f8 (link)
#134389 Condvar: implement wait_timeout for targets without threads fde2a23eb68bf73191f6cb7d2edc8054236b122f (link)
#134920 Convert typeck constraints in location-sensitive polonius 3396279dee2b071240d8fdf8844a298ce39b52f7 (link)
#135032 triagebot: register relnotes-interest-group ping group 5fa9cb33df4514cc11762dd94983e7ce50966690 (link)
#135176 More compelling env_clear() examples 92533f587520c62e27de90e06c8e7bb582cfa890 (link)
#135184 Reserve x18 register for aarch64 wrs vxworks target b485c004e709f3ddac13295c5821039f2ca74f79 (link)
#135203 arm: add unstable soft-float target feature 3db4e66e6fbf3e9de424e55b1e81bc989cc5f3ae (link)
#135219 warn about broken simd not only on structs but also enums a… da0a0b509b7a8a71d730670a645dd57d999b51dc (link)

previous master: 1f81f90689

In the case of a perf regression, run the following command for each PR you suspect might be the cause: @rust-timer build $SHA

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (9c87288): comparison URL.

Overall result: ❌ regressions - no action needed

@rustbot label: -perf-regression

Instruction count

This is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
1.4% [1.4%, 1.4%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary 1.7%, secondary 2.8%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
3.2% [1.9%, 4.5%] 2
Regressions ❌
(secondary)
2.8% [2.8%, 2.8%] 1
Improvements ✅
(primary)
-1.3% [-1.3%, -1.3%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.7% [-1.3%, 4.5%] 3

Cycles

Results (primary 2.1%, secondary 3.8%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
2.1% [2.1%, 2.1%] 1
Regressions ❌
(secondary)
3.8% [2.2%, 5.1%] 17
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.1% [2.1%, 2.1%] 1

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 763.035s -> 764.901s (0.24%)
Artifact size: 325.74 MiB -> 325.67 MiB (-0.02%)

@jhpratt jhpratt deleted the rollup-4gvvo4y branch January 14, 2025 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-meta Area: Issues & PRs about the rust-lang/rust repository itself merged-by-bors This PR was explicitly merged by bors. rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.