Skip to content

Rollup of 14 pull requests #145796

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 31 commits into from
Aug 24, 2025
Merged

Rollup of 14 pull requests #145796

merged 31 commits into from
Aug 24, 2025

Conversation

samueltardieu
Copy link
Member

@samueltardieu samueltardieu commented Aug 23, 2025

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

ognevny and others added 30 commits July 19, 2025 14:19
when building LLVM it's obvious that in case of shared build rustc doesn't need to be recompiled,
but with static builds it would be better to compile rustc again to ensure we linked proper library.
maybe I didn't understand the pipeline correctly, but it was strange for me to see that in Stage 5
LLVM is built while rustc is not
Darwin's `read`/`write` syscalls emit `EINVAL` only when `nbyte > INT_MAX`.
The case `nbyte == INT_MAX` is valid, so the subtraction can be removed.
By construction, `subpatterns` contains all fields in order. Witness
patterns are constructed with all fields in order by
`WitnessPat::wild_from_ctor` and `WitnessStack::apply_constructor`, and
the order is preserved at `write_struct_like`'s call-site in
`print_witness_pat`. It's thus no longer necessary to go looking for
fields or handle missing fields.
Save a few instructions in `encode_utf8_raw_unchecked` by performing
manual CSE.
By updating rustfmt to use `dirs-6.0.0`.
We also depend on `toml-0.7.8` and `toml-0.8.23`, but this one is easy
to get rid of.
To avoid workspace warnings.
* make attributes render inside code elements and inside divs with class `code-attribute`
* render attributes for macros, associated constants, and struct/union fields
MIR validation attempts to determine the number of bytes needed to
represent the size of the source type to compute the discriminant for
the inhabited target enum. For a ZST source, there is no source data to
use as a discriminant so no proper runtime check can be generated.

Since that should never be possible, insert a delayed bug to ensure the
problem has been properly reported to the user by the type checker.
…Kobzol

opt-dist: rebuild rustc when doing static LLVM builds

when building LLVM it's obvious that in case of shared build rustc doesn't need to be recompiled, but with static builds it would be better to compile rustc again to ensure we linked proper library.
maybe I didn't understand the pipeline correctly, but it was strange for me to see that in Stage 5 LLVM is built while rustc is not

r? ```@Kobzol```

try-job: dist-x86_64-msvc
try-job: dist-x86_64-linux
…, r=ChrisDenton

std/sys/fd: Relax `READ_LIMIT` on Darwin

Darwin's `read`/`write` syscalls emit `EINVAL` only when `nbyte > INT_MAX`. The case `nbyte == INT_MAX` is valid, so the subtraction (`- 1`) in
```rust
const READ_LIMIT: usize = if cfg!(target_vendor = "apple") {
    libc::c_int::MAX as usize - 1 // <- HERE
} else {
    libc::ssize_t::MAX as usize
};
```
can be removed.

I tested that the case `nbyte == INT_MAX` is valid on various versions of macOS, including old one like Mac OS X 10.5.

The man page says:
- read() and pread() will fail if the parameter nbyte exceeds INT_MAX (link: https://keith.github.io/xcode-man-pages/read.2.html)
- write() and pwrite() will fail if the parameter nbyte exceeds INT_MAX (link: https://keith.github.io/xcode-man-pages/write.2.html)

Here are links to Darwin's code:
- [macOS 15.5] https://github.com/apple-oss-distributions/xnu/blob/e3723e1f17661b24996789d8afc084c0c3303b26/bsd/kern/sys_generic.c#L307
- [Mac OS X 10.2] https://github.com/apple/darwin-xnu/blob/d738f900846ed2d5f685e18bf85ce63b0176f61a/bsd/kern/sys_generic.c#L220

Related PR: rust-lang#38622.
match exhaustiveness diagnostics: show a trailing comma on singleton tuple consructors in witness patterns (and clean up a little)

Constructor patterns of type `(T,)` are written `(pat,)`, not `(pat)`. However, exhaustiveness/usefulness diagnostics would print them as `(pat)` when e.g. providing a witness of non-exhaustiveness and suggesting adding arms to make matches exhaustive; this would result in an error when applied.
rust-analyzer already prints the trailing comma, so it doesn't need changing.

This also includes some cleanup in the second commit, with justification in the commit message.
…f8, r=Mark-Simulacrum

Optimize `char::encode_utf8`

Save a few instructions in `encode_utf8_raw_unchecked` by performing manual CSE.
interpret/allocation: get_range on ProvenanceMap

Helper method to grab all provenances in a given address range for an allocation, making some logic in Miri nicer.
port `sanitize` attribute to the new parsing infrastructure
…iler-errors

next-solver: fix `feature(const_trait_impl)` bootstrap

rarw

r? ``@compiler-errors`` ``@fee1-dead``
…artwright

Remove two duplicated crates

These commits remove `toml-0.5.11` and `dirs-sys-0.4.1`. There are later versions of those same crates already in the tree. Found with `cargo tree -d`.

r? ``@jieyouxu``
…compiler-errors

miri: also detect aliasing of in-place argument and return place

This is a follow-up to rust-lang#145585 where I forgot to deal with the case of the return place aliasing an in-place argument -- as ``@Amanieu`` mentioned in rust-lang#71117 (comment), that case must also be forbidden.

r? ``@compiler-errors``
…lt-opts-method, r=Kobzol

Remove default opts from config

We forgot to remove this method in rust-lang#145352. This PR removes that.

r? ```@Kobzol```
Remove profile section from Clippy

To avoid workspace warnings.

[This](rust-lang#145749) subtree sync started causing warnings in Rust builds (rust-lang#145777) because of the `profile` section in Clippy's `Cargo.toml` file. This profile section was added in rust-lang/rust-clippy#13408 last year, and since it also caused issues then, it was later reverted. However, this change recently reappeared in [this commit](rust-lang/rust-clippy@90364dd), so it is again causing issues for rust-lang/rust.

This PR removes the profile section again.

Fixes: rust-lang#145777
…ributes-rendering, r=GuillaumeGomez

rustdoc: make attributes render consistently

While working on rust-lang#132304, I discovered that even standard attributes aren't consistently rendered.
For some constructs/fields, attributes were missing entirely, and the attributes were only sometimes wrapped in a code-attribute divs so they appear greyed out.

In short this PR:
* makes attributes render inside code elements and inside divs with class `code-attribute`
* renders attributes for macros, associated constants, and struct/union fields

Attributes in `Fields` and `Variants` sections are still not rendered (see struct and enum screenshots), because I wasn't sure we want that.

[Compirison of tests/rustdoc/attributes.rs](https://github.com/karolzwolak/rust/blob/90aa25a1c5dbae1e94099b1a2015dfb83783dbe0/tests/rustdoc/attributes.rs)
Before (left) / after (right):

<img width="279" height="97" alt="image" src="https://github.com/user-attachments/assets/baca4b75-f809-4a76-8ac1-e3aa6389aad4" />
<img width="363" height="112" alt="image" src="https://github.com/user-attachments/assets/14970fb0-6fe5-474f-983e-5a95e16175c5" />

<img width="368" height="492" alt="image" src="https://github.com/user-attachments/assets/f9a25583-10e3-49c7-961b-34f3587b552e" />
<img width="415" height="515" alt="image" src="https://github.com/user-attachments/assets/f2fe4aa0-c731-4f2f-a3c2-04e524a858d1" />

<img width="383" height="483" alt="image" src="https://github.com/user-attachments/assets/bccc1b6e-f236-4948-8557-f9b25cad8a07" />
<img width="402" height="528" alt="image" src="https://github.com/user-attachments/assets/2cea9250-37e1-439e-8010-0603905d0f52" />

<img width="372" height="485" alt="image" src="https://github.com/user-attachments/assets/cd49bc0a-90e1-4d08-af0f-084c42af1834" />
<img width="406" height="542" alt="image" src="https://github.com/user-attachments/assets/67fb4ac7-746b-4e20-9c80-97702a71def8" />

<img width="357" height="131" alt="image" src="https://github.com/user-attachments/assets/42769532-1e4d-486d-bdca-6ecc409554b9" />
<img width="366" height="161" alt="image" src="https://github.com/user-attachments/assets/0b4d01d4-dd8e-4467-8cfc-ad58200ba0d7" />

<img width="291" height="65" alt="image" src="https://github.com/user-attachments/assets/43f61335-8eff-491b-a297-1953d17bbfc0" />
<img width="259" height="57" alt="image" src="https://github.com/user-attachments/assets/598618a3-e52f-4a4e-b790-2c8d5f1b4c77" />

r? ``@GuillaumeGomez``
…=Kobzol

citool: cleanup `mismatched_lifetime_syntaxes` warnings

Those lifetimes are implicit earlier in the same signature, and should not be hidden in the output type.
…validation, r=compiler-errors

Fix ICE when validating transmuting ZST to inhabited enum

MIR validation attempts to determine the number of bytes needed to represent the size of the source type to compute the discriminant for the inhabited target enum. For a ZST source, there is no source data to use as a discriminant so no proper runtime check can be generated.

Since that should never be possible, insert a delayed bug to ensure the problem has been properly reported to the user by the type checker.

Fixes rust-lang#145786
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-CI Area: Our Github Actions CI A-testsuite Area: The testsuite used to check the correctness of rustc 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-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure 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. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. T-rustfmt Relevant to the rustfmt team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) rollup A PR which is a rollup labels Aug 23, 2025
@samueltardieu
Copy link
Member Author

@bors r+ rollup=never p=5

@bors
Copy link
Collaborator

bors commented Aug 23, 2025

📌 Commit 4d38062 has been approved by samueltardieu

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

bors commented Aug 23, 2025

⌛ Testing commit 4d38062 with merge f6d2341...

@bors
Copy link
Collaborator

bors commented Aug 24, 2025

☀️ Test successful - checks-actions
Approved by: samueltardieu
Pushing f6d2341 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 24, 2025
@bors bors merged commit f6d2341 into rust-lang:master Aug 24, 2025
11 checks passed
@rustbot rustbot added this to the 1.91.0 milestone Aug 24, 2025
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 69b76df (parent) -> f6d2341 (this PR)

Test differences

Show 58 test diffs

Stage 1

  • errors::verify_codegen_ssa_aarch64_softfloat_neon_128: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_aarch64_softfloat_neon_129: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_aix_strip_not_used_124: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_aix_strip_not_used_125: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_compiler_builtins_cannot_call_122: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_compiler_builtins_cannot_call_123: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_dlltool_fail_import_library_118: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_dlltool_fail_import_library_119: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_dynamic_linking_with_lto_137: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_dynamic_linking_with_lto_138: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_error_calling_dlltool_120: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_error_calling_dlltool_121: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_error_creating_import_library_123: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_error_creating_import_library_124: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_error_creating_remark_dir_121: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_error_creating_remark_dir_122: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_error_writing_def_file_119: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_error_writing_def_file_120: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_failed_to_get_layout_117: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_failed_to_get_layout_118: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_feature_not_valid_133: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_feature_not_valid_134: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_forbidden_ctarget_feature_131: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_forbidden_ctarget_feature_132: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_forbidden_target_feature_attr_116: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_forbidden_target_feature_attr_117: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_invalid_sanitize_115: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_lto_disallowed_134: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_lto_disallowed_135: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_lto_dylib_135: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_lto_dylib_136: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_lto_proc_macro_136: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_lto_proc_macro_137: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_no_mangle_nameless_132: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_no_mangle_nameless_133: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_target_feature_safe_trait_115: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_target_feature_safe_trait_116: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_unknown_ctarget_feature_prefix_129: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_unknown_ctarget_feature_prefix_130: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_unstable_ctarget_feature_130: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_unstable_ctarget_feature_131: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_xcrun_failed_invoking_125: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_xcrun_failed_invoking_126: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_xcrun_sdk_path_warning_127: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_xcrun_sdk_path_warning_128: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_xcrun_unsuccessful_126: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_xcrun_unsuccessful_127: pass -> [missing] (J0)
  • [ui] tests/ui/mir/validate/ice-zst-as-discr-145786.rs: [missing] -> pass (J1)
  • [ui] tests/ui/traits/const-traits/constructor-const-fn.rs: [missing] -> pass (J1)
  • [ui] tests/ui/traits/const-traits/reservation-impl-ice.rs: [missing] -> pass (J1)

Stage 2

  • [ui] tests/ui/mir/validate/ice-zst-as-discr-145786.rs: [missing] -> pass (J2)
  • [ui] tests/ui/traits/const-traits/constructor-const-fn.rs: [missing] -> pass (J2)
  • [ui] tests/ui/traits/const-traits/reservation-impl-ice.rs: [missing] -> pass (J2)

Additionally, 5 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 f6d23413c399fb530be362ebcf25a4e788e16137 --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-apple-various: 4740.3s -> 5929.4s (25.1%)
  2. dist-powerpc-linux: 5442.5s -> 4947.2s (-9.1%)
  3. dist-aarch64-apple: 7095.1s -> 6460.8s (-8.9%)
  4. pr-check-2: 2159.8s -> 2344.6s (8.6%)
  5. dist-sparcv9-solaris: 5296.5s -> 4938.8s (-6.8%)
  6. dist-arm-linux-musl: 5545.5s -> 5908.5s (6.5%)
  7. x86_64-mingw-1: 9812.9s -> 10363.8s (5.6%)
  8. dist-x86_64-mingw: 8295.6s -> 8745.8s (5.4%)
  9. dist-x86_64-apple: 7344.0s -> 7718.3s (5.1%)
  10. aarch64-msvc-1: 6932.7s -> 6608.1s (-4.7%)
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

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#143898 opt-dist: rebuild rustc when doing static LLVM builds d7b3240cee94ffa1c93b7d1b500a18513aeb532d (link)
#144452 std/sys/fd: Relax READ_LIMIT on Darwin 75968d68afb004cce678040b1b60bf0a9b365f8b (link)
#145234 match exhaustiveness diagnostics: show a trailing comma on … c3722725c7100b5dca7ff8c28cb79ae6b54a1928 (link)
#145515 Optimize char::encode_utf8 1e8bee0eb9c8a8b87f48b484cb0164033ef98979 (link)
#145540 interpret/allocation: get_range on ProvenanceMap 18e91871998f98fc7b9bed7a17e7aba95663b838 (link)
#145670 port sanitize attribute to the new parsing infrastructure cdfd90add626b707963b10308599af7c5c998a5b (link)
#145713 next-solver: fix feature(const_trait_impl) bootstrap 3e4e2d3406b751739c75539885bfd1d0395547ae (link)
#145729 Remove two duplicated crates 413f1a5486d27e03cdec09bc2137e2327be9645b (link)
#145744 miri: also detect aliasing of in-place argument and return … ca8ca0e4126d7b37b7353d047bc594a8b71b3d12 (link)
#145774 Remove default opts from config 595d86ba766cba109f4e9f18c851df8c94c3d507 (link)
#145781 Remove profile section from Clippy 8b4c8e397c04a431823c70e7f8e7491e99a6d895 (link)
#145782 rustdoc: make attributes render consistently 48efd1b283380ec5dfc4710287c3a4ffdecd7892 (link)
#145787 citool: cleanup mismatched_lifetime_syntaxes warnings 43edf977bbc115d46cd3f36f6ec99bf426c17292 (link)
#145791 Fix ICE when validating transmuting ZST to inhabited enum 892230f5a42e7f81ea4936ef0b65af280fe6c9a2 (link)

previous master: 69b76df90c

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

Overall result: ❌✅ regressions and improvements - please read the text below

Our benchmarks found a performance regression caused by this PR.
This might be an actual regression, but it can also be just noise.

Next Steps:

  • If the regression was expected or you think it can be justified,
    please write a comment with sufficient written justification, and add
    @rustbot label: +perf-regression-triaged to it, to mark the regression as triaged.
  • If you think that you know of a way to resolve the regression, try to create
    a new PR with a fix for the regression.
  • If you do not understand the regression or you think that it is just noise,
    you can ask the @rust-lang/wg-compiler-performance working group for help (members of this group
    were already notified of this PR).

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.8% [0.8%, 0.9%] 2
Regressions ❌
(secondary)
1.5% [1.5%, 1.5%] 1
Improvements ✅
(primary)
-0.4% [-0.4%, -0.3%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.2% [-0.4%, 0.9%] 4

Max RSS (memory usage)

Results (primary -0.8%, secondary 1.7%)

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

mean range count
Regressions ❌
(primary)
3.3% [3.3%, 3.3%] 1
Regressions ❌
(secondary)
1.7% [1.7%, 1.7%] 1
Improvements ✅
(primary)
-2.2% [-3.2%, -1.2%] 3
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.8% [-3.2%, 3.3%] 4

Cycles

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

Binary size

Results (primary 0.1%, secondary 0.2%)

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

mean range count
Regressions ❌
(primary)
0.1% [0.0%, 0.7%] 15
Regressions ❌
(secondary)
0.2% [0.0%, 0.7%] 6
Improvements ✅
(primary)
-0.1% [-0.1%, -0.0%] 7
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.1% [-0.1%, 0.7%] 22

Bootstrap: 466.542s -> 468.54s (0.43%)
Artifact size: 378.32 MiB -> 378.30 MiB (-0.01%)

@rustbot rustbot added the perf-regression Performance regression. label Aug 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) A-CI Area: Our Github Actions CI A-testsuite Area: The testsuite used to check the correctness of rustc merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. 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-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure 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. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. T-rustfmt Relevant to the rustfmt team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)
Projects
None yet
Development

Successfully merging this pull request may close these issues.