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 7 pull requests #125552

Merged
merged 20 commits into from
May 26, 2024
Merged

Rollup of 7 pull requests #125552

merged 20 commits into from
May 26, 2024

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

pitaj and others added 20 commits February 20, 2024 20:55
Luckily it's comparatively simple to just restore the `VecDeque` into a valid state on unwinds.
This way, no other test can be tripped up by `test_shrink_to_unwind` changing the alloc error hook.
…ue types.

We already handle this case this way on the coherence side, and it matches the new solver's behaviour. While there is some breakage around type-alias-impl-trait (see new "type annotations needed" in tests/ui/type-alias-impl-trait/issue-84660-unsoundness.rs), no stable code breaks, and no new stable code is accepted.
No stable code is affected, as this requires the `trait_upcasting` feature gate.
LLVM component names are not immediately obvious (they usually omit any
suffixes on the target arch name), and if they're incorrect, the test
will silently never run.
Stabilize `LazyCell` and `LazyLock`

Closes rust-lang#109736

This stabilizes the [`LazyLock`](https://doc.rust-lang.org/stable/std/sync/struct.LazyLock.html) and [`LazyCell`](https://doc.rust-lang.org/stable/std/cell/struct.LazyCell.html) types:

```rust
static HASHMAP: LazyLock<HashMap<i32, String>> = LazyLock::new(|| {
    println!("initializing");
    let mut m = HashMap::new();
    m.insert(13, "Spica".to_string());
    m.insert(74, "Hoyten".to_string());
    m
});

let lazy: LazyCell<i32> = LazyCell::new(|| {
    println!("initializing");
    92
});
```

r? libs-api
…acrum

Fix `VecDeque::shrink_to` UB when `handle_alloc_error` unwinds.

Fixes rust-lang#123369

For `VecDeque` it's relatively simple to restore the buffer into a consistent state so this PR does just that.

Note that with its current implementation, `shrink_to` may change the internal arrangement of elements in the buffer, so e.g. `[D, <uninit>, A, B, C]` will become `[<uninit>, A, B, C, D]` and `[<uninit>, <uninit>, A, B, C]` may become `[B, C, <uninit>, <uninit>, A]` if `shrink_to` unwinds. This shouldn't be an issue though as we don't make any guarantees about the stability of the internal buffer arrangement (and this case is impossible to hit on stable anyways).

This PR also includes a test with code adapted from rust-lang#123369 which fails without the new `shrink_to` code. Does this suffice or do we maybe need more exhaustive tests like in rust-lang#108475?

cc `@Amanieu`

`@rustbot` label +T-libs
…ompiler-errors

Some unstable changes to where opaque types get defined

None of these can be reached from stable afaict.

r? ``@compiler-errors``

cc rust-lang#116652
tidy: validate LLVM component names in tests

LLVM component names are not immediately obvious (they usually omit any suffixes on the target arch name), and if they're incorrect, the test will silently never run.

This happened [here](rust-lang#125220 (comment)), and it would be nice to prevent it.
Exit the process a short time after entering our ctrl-c handler

Fixes rust-lang#124212

r? `@bjorn3`
@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels May 25, 2024
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=7

@bors
Copy link
Contributor

bors commented May 25, 2024

📌 Commit 0ded36f has been approved by matthiaskrgr

It is now in the queue for this repository.

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

bors commented May 25, 2024

⌛ Testing commit 0ded36f with merge 0a59f11...

@bors
Copy link
Contributor

bors commented May 26, 2024

☀️ Test successful - checks-actions
Approved by: matthiaskrgr
Pushing 0a59f11 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label May 26, 2024
@bors bors merged commit 0a59f11 into rust-lang:master May 26, 2024
7 checks passed
@rustbot rustbot added this to the 1.80.0 milestone May 26, 2024
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#121377 Stabilize LazyCell and LazyLock f3b13b3f267353de6c1236fdbe093e7afd48bfeb (link)
#122986 Fix c_char on AIX 9b77f0d2ad05af0ba90584bb7b3a4be46e52dfb6 (link)
#123803 Fix VecDeque::shrink_to UB when handle_alloc_error unwi… 32ba24ca55f1a4ca852e293ac6b0b507298d8f1e (link)
#124080 Some unstable changes to where opaque types get defined 7baacc50b569b670af5e9b9a1365267384352829 (link)
#124667 Stabilize div_duration dc9cd92b09c0da4ad7cbab731b0d6e2b96fdd93a (link)
#125472 tidy: validate LLVM component names in tests 42829871907a1786ec5387b24675efbed76ecc22 (link)
#125523 Exit the process a short time after entering our ctrl-c han… ecc586950069ebf0a301b753dcdf98b1e37785f9 (link)

previous master: 1ba35e9bb4

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 (0a59f11): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

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

Max RSS (memory usage)

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

Cycles

Results (secondary 0.0%)

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)
- - 0
Regressions ❌
(secondary)
2.5% [2.5%, 2.5%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.4% [-2.4%, -2.4%] 1
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 672.69s -> 670.899s (-0.27%)
Artifact size: 315.68 MiB -> 315.75 MiB (0.02%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic 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-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet