Skip to content

Rollup of 5 pull requests #145805

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

Merged
merged 26 commits into from
Aug 24, 2025
Merged

Rollup of 5 pull requests #145805

merged 26 commits into from
Aug 24, 2025

Conversation

jhpratt
Copy link
Member

@jhpratt jhpratt commented Aug 24, 2025

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

Kobzol and others added 26 commits August 7, 2025 10:41
Only run the pull workflow once per week
The official Discord server is no longer active (cannot be posted to).
…english-writing

Add a tip for english writing
Also, remove redundant word
This updates the rust-version file to 425a9c0.
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: 425a9c0
Filtered ref: 26b9fd24259f4fc5fd7634a99dd6dda2821fb2d0

This merge was created using https://github.com/rust-lang/josh-sync.
Fixes an issue where if the underlying `Once` panics because it is
poisoned, the panic displays the wrong message.

Signed-off-by: Connor Tsui <[email protected]>
…kh726

Add lint against integer to pointer transmutes

# `integer_to_ptr_transmutes`

*warn-by-default*

The `integer_to_ptr_transmutes` lint detects integer to pointer transmutes where the resulting pointers are undefined behavior to dereference.

### Example

```rust
fn foo(a: usize) -> *const u8 {
    unsafe {
        std::mem::transmute::<usize, *const u8>(a)
    }
}
```

```
warning: transmuting an integer to a pointer creates a pointer without provenance
   --> a.rs:1:9
    |
158 |         std::mem::transmute::<usize, *const u8>(a)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: this is dangerous because dereferencing the resulting pointer is undefined behavior
    = note: exposed provenance semantics can be used to create a pointer based on some previously exposed provenance
    = help: if you truly mean to create a pointer without provenance, use `std::ptr::without_provenance_mut`
    = help: for more information about transmute, see <https://doc.rust-lang.org/std/mem/fn.transmute.html#transmutation-between-pointers-and-integers>
    = help: for more information about exposed provenance, see <https://doc.rust-lang.org/std/ptr/index.html#exposed-provenance>
    = note: `#[warn(integer_to_ptr_transmutes)]` on by default
help: use `std::ptr::with_exposed_provenance` instead to use a previously exposed provenance
    |
158 -     std::mem::transmute::<usize, *const u8>(a)
158 +     std::ptr::with_exposed_provenance::<u8>(a)
    |
```

### Explanation

Any attempt to use the resulting pointers are undefined behavior as the resulting pointers won't have any provenance.

Alternatively, `std::ptr::with_exposed_provenance` should be used, as they do not carry the provenance requirement or if the wanting to create pointers without provenance `std::ptr::without_provenance_mut` should be used.

See [std::mem::transmute] in the reference for more details.

[std::mem::transmute]: https://doc.rust-lang.org/std/mem/fn.transmute.html

--------

People are getting tripped up on this, see rust-lang#128409 and rust-lang#141220. There are >90 cases like these on [GitHub search](https://github.com/search?q=lang%3Arust+%2Ftransmute%3A%3A%3Cu%5B0-9%5D*.*%2C+%5C*const%2F&type=code).

Fixes rust-lang/rust-clippy#13140
Fixes rust-lang#141220
Fixes rust-lang#145523

`@rustbot` labels +I-lang-nominated +T-lang
cc `@traviscross`
r? compiler
…r=Amanieu

Fix `LazyLock` poison panic message

Fixes the issue raised in rust-lang#144872 (comment)

r? ```@Amanieu```
rustc-dev-guide subtree update

Subtree update of `rustc-dev-guide` to rust-lang/rustc-dev-guide@c221508.

Created using https://github.com/rust-lang/josh-sync.

r? ```@ghost```
…, r=lqd

Use unnamed lifetime spans as primary spans for `MISMATCHED_LIFETIME_SYNTAXES`

Fixes rust-lang#145772

This PR changes the primary span(s) of the `MISMATCHED_LIFETIME_SYNTAXES` to point to the *unnamed* lifetime spans in both the inputs and *outputs* of the function signature. As reported in rust-lang#145772, this should make it so that IDEs highlight the spans of the actionable part of this lint, rather than just the (possibly named) input spans like they do today.

This could be tweaked further perhaps, for example for `fn foo(_: T<'_>) -> T`, we don't need to highlight the elided lifetime if the actionable part is to change only the return type to `T<'_>`, but I think it's improvement on what's here today, so I think that should be follow-up since I think the logic might get a bit hairy.

cc ```@shepmaster```
std/src/lib.rs: mention "search button" instead of "search bar"

r? ```@GuillaumeGomez```
@rustbot rustbot added A-rustc-dev-guide Area: rustc-dev-guide S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 24, 2025
@rustbot rustbot added T-libs Relevant to the library team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Aug 24, 2025
@jhpratt
Copy link
Member Author

jhpratt commented Aug 24, 2025

@bors r+ rollup=never p=5

@bors
Copy link
Collaborator

bors commented Aug 24, 2025

📌 Commit 7a3675c has been approved by jhpratt

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 Aug 24, 2025
@bors
Copy link
Collaborator

bors commented Aug 24, 2025

⌛ Testing commit 7a3675c with merge 4eedad3...

@bors
Copy link
Collaborator

bors commented Aug 24, 2025

☀️ Test successful - checks-actions
Approved by: jhpratt
Pushing 4eedad3 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 24, 2025
@bors bors merged commit 4eedad3 into rust-lang:master Aug 24, 2025
11 checks passed
@rustbot rustbot added this to the 1.91.0 milestone Aug 24, 2025
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#144531 Add lint against integer to pointer transmutes 6a2b3e1bd580a057515d43cadd0c54dc757d35bd (link)
#145307 Fix LazyLock poison panic message 762d21b14b55c96b42f5fc8aa1be2bf00c51fb0a (link)
#145554 rustc-dev-guide subtree update 0f5833cf92e0e764ef52c01178644238b4d8cb1f (link)
#145798 Use unnamed lifetime spans as primary spans for `MISMATCHED… 50afbdfa59e35add5b9de7754ada87edc0b0f01d (link)
#145799 std/src/lib.rs: mention "search button" instead of "search … 1c198a1f9c26b338c0fbc1e8be090a040965a986 (link)

previous master: f6d23413c3

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

Copy link
Contributor

What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing f6d2341 (parent) -> 4eedad3 (this PR)

Test differences

Show 91 test diffs

Stage 1

  • lazy_lock::lazy_force_mut_panic: pass -> [missing] (J0)
  • lazy_lock::lazy_lock_deref_mut_panic: [missing] -> pass (J0)
  • lazy_lock::lazy_lock_deref_panic: [missing] -> pass (J0)
  • lazy_lock::lazy_lock_preserves_closure_panic_message: [missing] -> pass (J0)
  • lazy_lock::sync_lazy_poisoning: pass -> [missing] (J0)
  • [ui] tests/ui/lint/int_to_ptr.rs: [missing] -> pass (J2)

Stage 2

  • [ui] tests/ui/lint/int_to_ptr.rs: [missing] -> pass (J1)

Additionally, 84 doctest diffs were found. These are ignored, as they are noisy.

Job group index

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 4eedad312695d773b6e2e17a4f8082660470c101 --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. dist-aarch64-linux: 8799.8s -> 6292.7s (-28.5%)
  2. dist-apple-various: 5929.4s -> 4610.1s (-22.2%)
  3. dist-x86_64-apple: 7718.3s -> 6452.7s (-16.4%)
  4. pr-check-1: 1620.5s -> 1377.3s (-15.0%)
  5. aarch64-gnu-debug: 4973.9s -> 4268.9s (-14.2%)
  6. x86_64-rust-for-linux: 2973.5s -> 2590.4s (-12.9%)
  7. aarch64-msvc-2: 4805.0s -> 5423.2s (12.9%)
  8. x86_64-gnu-llvm-19: 2878.0s -> 2518.5s (-12.5%)
  9. i686-gnu-1: 8316.8s -> 7443.7s (-10.5%)
  10. x86_64-gnu-miri: 5046.0s -> 4523.6s (-10.4%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (4eedad3): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

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

Max RSS (memory usage)

Results (primary 4.2%, secondary -2.1%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

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

Cycles

Results (secondary -4.5%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

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

Binary size

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

Bootstrap: 468.54s -> 467.477s (-0.23%)
Artifact size: 378.30 MiB -> 378.32 MiB (0.01%)

@jhpratt jhpratt deleted the rollup-h1bm4z7 branch August 24, 2025 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustc-dev-guide Area: rustc-dev-guide 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-clippy Relevant to the Clippy team. 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.