Skip to content

Rollup of 8 pull requests #141366

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 16 commits into from
May 22, 2025
Merged

Rollup of 8 pull requests #141366

merged 16 commits into from
May 22, 2025

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

Natr1x and others added 16 commits April 30, 2025 20:25
8 and 16-bit integers are subject to upcasting in C, and hence are not reliably safe. users should perform their own casting and deal with the consequences
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
This way after_crate_root_parsing and -Zpretty will see them.
…n, r=dtolnay

docs: Specify that common sort functions sort in an ascending direction

From [forum discussion](https://users.rust-lang.org/t/is-there-a-way-to-sort-a-slice-in-specifically-ascending-or-descending-order/128998?u=natr1x) it seems like the sorting direction can be expected to always be ascending (in terms of `cmp::Ordering`).

If this is the case then it would be nice to have this stated in the documentation.
std: fix doctest and explain for `as_slices` and `as_mut_slices` in `VecDeque`

Fixes rust-lang#141217

r? libs
…r=workingjubilee

limit impls of `VaArgSafe` to just types that are actually safe

tracking issue: rust-lang#44930

Retrieving 8- or 16-bit integer arguments from a `VaList` is not safe, because such types are subject to upcasting. See rust-lang#61275 (comment) for more detail.

This PR also makes the instances of `VaArgSafe` visible in the documentation, and uses a private sealed trait to make sure users cannot create additional impls of `VaArgSafe`, which would almost certainly cause UB.

r? `@workingjubilee`
…piler-errors

incorrectly prefer builtin `dyn` impls :3

This makes rust-lang#57893 slightly more exploitable with the new solver. It's still strictly better than the old solver and the underlying unsoundness persists in the new one even without this preference.

Properly fixing rust-lang#57893 is something we've been looking at more deeply recently and discussed at the [Types Meetup during the All-Hands](https://hackmd.io/rz-4ghMzTb2wXOkdLKHaHw#Dyn-traits). Whatever approach we'll end up deciding on will likely require a fairly long transition period and some significant further design work. This should not block `-Znext-solver`.

fixes rust-lang/trait-system-refactor-initiative#183

r? `@compiler-errors` cc `@rust-lang/types`
…drieril

Move -Zcrate-attr injection to just after crate root parsing

This way `after_crate_root_parsing` and `-Zpretty` will see them.
…dy-expr, r=compiler-errors

lower bodies' params to thir before the body's value

Two motivations for this:
- Lowering params first means errors from lowering the params are emitted before errors from lowering the body's expression. This comes up in [tests/ui/associated-consts/associated-const-type-parameter-pattern.stderr](https://github.com/rust-lang/rust/compare/master...dianne:rust:thir-lower-params-before-body-expr?expand=1#diff-acac6ea10e991af0da91633e08b2739f9f9ca0c8f826401b6ba829914d0806f2), where both the params and expression encounter errors in translating consts to patterns. This change puts the errors in the order they appear in the source file.
- Guard patterns (rust-lang#129967) contain expressions, so lowering params containing guard patterns may add more expressions to the THIR. However, there's a check for `-Zunpretty=thir-tree` that the final expression in the THIR corresponds to its value [(link)](https://github.com/rust-lang/rust/blob/c43786c9b7b8d8dcc3f9c604e0e3074c16ed69d3/compiler/rustc_mir_build/src/builder/mod.rs#L453-L455); lowering params last would break this. As an alternative way to get guard patterns to work, I think the pretty-printer could use the expression returned by `thir_body` and the check could be removed or changed (rust-lang#141357).
…ee-body-expr, r=compiler-errors

`unpretty=thir-tree`: don't require the final expr to be the body's value

Two motivations for this:
- I couldn't find a comment motivating this hard-coding. I can imagine it might be easier to read `unpretty=thir-flat` output if the final expression in the THIR is always the body's value, but if that's the reason, that should be the justification in the source. I can also imagine it's meant to check that all expressions will be visited by the pretty-printer, but the existing check doesn't quite do that either.
- Guard patterns (rust-lang#129967) contain expressions, so lowering params containing guard patterns may add more expressions to the THIR. Currently a body's params are lowered after its expression, so guard expressions in params would end up last, breaking this. As an alternative, the params could be lowered first (rust-lang#141356).
Document why we allow escaping bound vars in LTA norm

r? lcnr

followup from the const normalization PR. I think I now understand why free alias norm is funny about binders
@rustbot rustbot added A-run-make Area: port run-make Makefiles to rmake.rs 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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) rollup A PR which is a rollup labels May 21, 2025
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=5

@bors
Copy link
Collaborator

bors commented May 21, 2025

📌 Commit de4055f 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 21, 2025
@bors
Copy link
Collaborator

bors commented May 21, 2025

⌛ Testing commit de4055f with merge 5df0f72...

@bors
Copy link
Collaborator

bors commented May 22, 2025

☀️ Test successful - checks-actions
Approved by: matthiaskrgr
Pushing 5df0f72 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label May 22, 2025
@bors bors merged commit 5df0f72 into rust-lang:master May 22, 2025
7 checks passed
@rustbot rustbot added this to the 1.89.0 milestone May 22, 2025
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#140526 docs: Specify that common sort functions sort in an ascendi… e4ee8e65fed87092b62c448df559f1f5fd2e79da (link)
#141230 std: fix doctest and explain for as_slices and `as_mut_sl… 1a8cf8407106a5d2b7a9daf5440c4564a68328f2 (link)
#141341 limit impls of VaArgSafe to just types that are actually … e18ec4ba75d5e7055ca5975a54c4c9c98719c903 (link)
#141347 incorrectly prefer builtin dyn impls :3 856e2e6687f2fec47e1ed0424d3967796f1104fd (link)
#141351 Move -Zcrate-attr injection to just after crate root parsing 1f6ffe4dbab6262bbf307e689a4279d421d1d2c4 (link)
#141356 lower bodies' params to thir before the body's value e29f4282a6b7e39c724033388614871b6bcd1808 (link)
#141357 unpretty=thir-tree: don't require the final expr to be th… d04de51ad8bab930d03bf4a2400319494c6d660a (link)
#141363 Document why we allow escaping bound vars in LTA norm eb16a7b270dc4edd8607ede6254fec8499fe2a7d (link)

previous master: bf64d66bd5

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

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 bf64d66 (parent) -> 5df0f72 (this PR)

Test differences

Show 220 test diffs

Stage 1

  • [ui] tests/ui/traits/next-solver/assembly/better_any-backcompat.rs#current: [missing] -> pass (J0)
  • [ui] tests/ui/traits/next-solver/assembly/better_any-backcompat.rs#next: [missing] -> pass (J0)

Stage 2

  • [ui] tests/ui/traits/next-solver/assembly/better_any-backcompat.rs#current: [missing] -> pass (J1)
  • [ui] tests/ui/traits/next-solver/assembly/better_any-backcompat.rs#next: [missing] -> pass (J1)

Additionally, 216 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 5df0f729f5355cb3cd91f6bcff13566ae96dc220 --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. x86_64-apple-1: 10365.9s -> 8252.9s (-20.4%)
  2. aarch64-apple: 4361.4s -> 5119.1s (17.4%)
  3. dist-x86_64-apple: 10232.0s -> 8737.7s (-14.6%)
  4. dist-apple-various: 7362.2s -> 6446.4s (-12.4%)
  5. x86_64-apple-2: 5472.3s -> 4888.6s (-10.7%)
  6. dist-aarch64-apple: 6023.5s -> 5421.3s (-10.0%)
  7. x86_64-gnu-stable: 6668.3s -> 7050.7s (5.7%)
  8. arm-android: 5505.8s -> 5210.4s (-5.4%)
  9. dist-arm-linux-gnueabi: 5246.9s -> 5024.5s (-4.2%)
  10. aarch64-gnu: 6390.1s -> 6659.3s (4.2%)
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 (5df0f72): 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 (secondary 0.6%)

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.1% [2.1%, 2.1%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-1.0% [-1.0%, -1.0%] 1
All ❌✅ (primary) - - 0

Cycles

Results (secondary -2.4%)

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

Binary size

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

Bootstrap: 776.537s -> 776.959s (0.05%)
Artifact size: 365.59 MiB -> 365.55 MiB (-0.01%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-run-make Area: port run-make Makefiles to rmake.rs 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. 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.