Skip to content

Rollup of 8 pull requests #141668

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

Rollup of 8 pull requests #141668

merged 22 commits into from
May 28, 2025

Conversation

tgross35
Copy link
Contributor

@tgross35 tgross35 commented May 28, 2025

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

dianqk and others added 22 commits May 19, 2025 21:35
We cannot transform `*elem` to `array[idx1]` in the following code,
as `idx1` has already been modified.

```rust
    mir! {
        let array;
        let elem;
        {
            array = [*val; 5];
            elem = &array[idx1];
            idx1 = idx2;
            RET = *elem;
            Return()
        }
    }
```
To include beta backport of revert
<rust-lang#141024> which should undo linker
warnings during bootstrapping of Windows MSVC targets due to
<rust-lang#140176>.
add `asm_cfg`: `#[cfg(...)]` within `asm!`

tracking issue: rust-lang#140364
blocked on: rust-lang#140490

This feature was discussed in rust-lang#140279. It allows configuring templates and operands in the assembly macros, for example:

```rust
asm!( // or global_asm! or naked_asm!
    "nop",
    #[cfg(target_feature = "sse2")]
    "nop",
    // ...
    #[cfg(target_feature = "sse2")]
    a = const 123, // only used on sse2
);
```

r? `@tgross35`

cc `@traviscross` `@Amanieu`

Now builds on rust-lang#140490, which should be merged first.
…meGomez

Make check-cfg diagnostics work in `#[doc(cfg(..))]`

This PR makes it so that the check-cfg `unexpected_cfgs` lint, is correctly emitted in `rustdoc`'s `#[doc(cfg(..))]`.

This is achieved by adding a custom trait to `cfg_matches` (the method that emits the lint) which permits `rustc` and `rustdoc` to each have their way to emitting lints (via buffered lints/AST for `rustc` and via `TyCtxt`/HIR for `rustdoc`).

The reason this is required is because buffered lints operates on the AST but `rustdoc` uses the HIR and by the time `rustdoc` calls `cfg_matches` we are way passed the point where buffered lints have been drain and emitted.

Best reviewed commit by commit.

r? `@jieyouxu` (for the compiler part)
r? `@GuillaumeGomez` (for the rustdoc part)
gvn: bail out unavoidable non-ssa locals in repeat

Fixes rust-lang#141251.

We cannot transform `*elem` to `array[idx1]` in the following code, as `idx1` has already been modified.

```rust
    mir! {
        let array;
        let elem;
        {
            array = [*val; 5];
            elem = &array[idx1];
            idx1 = idx2;
            RET = *elem;
            Return()
        }
    }
```

Perhaps I could transform it to `array[0]`, but I prefer the conservative approach.

r? mir-opt
…ip-ignore-141092, r=notriddle

rustdoc: use descriptive tooltip if doctest is conditionally ignored

fixes rust-lang#141092

here's what it looks like now:
![screenshot](https://github.com/user-attachments/assets/71e679fe-8828-439d-a2ce-b9187ad3aeea)
Make two transmute-related MIR lints into HIR lint

Make `PTR_TO_INTEGER_TRANSMUTE_IN_CONSTS` (rust-lang#130540) and `UNNECESSARY_TRANSMUTES` (rust-lang#136083) into "normal" HIR-based lints.

Funny enough this came up in the review of the latter (rust-lang#136083 (comment)), but I guess it just was overlooked.

But anywyas, there's no reason for these to be MIR lints; in fact, it makes the suggestions for them a bit more complicated than necessary.

Note that there's probably a few more simplifications and improvements to be done here. Follow-ups can be done in a separate PR, especially if they're about the messaging and suggestions themselves, which I didn't write.
…r=Kobzol

ci: fix llvm test coverage

try-job: x86_64-gnu-llvm-19-1
try-job: x86_64-gnu-llvm-20-1
…troalbini

Bump master `stage0` compiler

To include beta backport of revert rust-lang#141024 which should undo linker warnings during bootstrapping of Windows MSVC targets due to rust-lang#140176.

Closes rust-lang#141395.

r? `@Mark-Simulacrum` (or release)
Add `Result::map_or_default` and `Option::map_or_default`

Closes: rust-lang#138068

_This PR has been recreated because of the inactivity of the author (Cf. rust-lang#138068 (comment)
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) 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-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-release Relevant to the release subteam, which will review and decide on the PR/issue. labels May 28, 2025
@rustbot rustbot added 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. rollup A PR which is a rollup labels May 28, 2025
@tgross35
Copy link
Contributor Author

@bors r+ rollup=never p=5

@bors
Copy link
Collaborator

bors commented May 28, 2025

📌 Commit da61494 has been approved by tgross35

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

bors commented May 28, 2025

⌛ Testing commit da61494 with merge 04a67d5...

@bors
Copy link
Collaborator

bors commented May 28, 2025

☀️ Test successful - checks-actions
Approved by: tgross35
Pushing 04a67d5 to master...

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

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#140367 add asm_cfg: #[cfg(...)] within asm! 2661a166eccfd1fa8c5b991c181f0fbc36632d09 (link)
#140894 Make check-cfg diagnostics work in #[doc(cfg(..))] 4c9be35bd27b58a9427b4f3ed60858accd7d4b49 (link)
#141252 gvn: bail out unavoidable non-ssa locals in repeat 11adb2b33062edf9feb29f85a53a305002a0806e (link)
#141517 rustdoc: use descriptive tooltip if doctest is conditionall… a524f0ca1b1f0cb7c441b02fe15beaddb066f4d3 (link)
#141551 Make two transmute-related MIR lints into HIR lint b294c0b5a6427c6b119639730e58642351e732b5 (link)
#141591 ci: fix llvm test coverage 99a0d75ca3830ce8a3baad2607f762d8457bd300 (link)
#141647 Bump master stage0 compiler 10c6478bcee080ba7bf1d43bc894dc8893ada95a (link)
#141659 Add Result::map_or_default and Option::map_or_default f134ee191e4171a39fa4c2114cf10efc1e250fc2 (link)

previous master: be42293944

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 be42293 (parent) -> 04a67d5 (this PR)

Test differences

Show 40450 test diffs

Stage 1

  • errors::verify_builtin_macros_naked_functions_testing_attribute_93: pass -> [missing] (J0)
  • ascii::medium::is_ascii_graphic: pass -> [missing] (J1)
  • btree::map::clone_slim_10k_and_clear: pass -> [missing] (J1)
  • clone::test_clone_from: pass -> [missing] (J1)
  • collections::btree::map::tests::test_clone_from: pass -> [missing] (J1)
  • collections::btree::map::tests::test_into_iter_drop_leak_kv_panic_in_val: pass -> [missing] (J1)
  • collections::btree::map::tests::test_range_large: pass -> [missing] (J1)
  • collections::hash::map::tests::test_extend_ref: pass -> [missing] (J1)
  • collections::linked_list::tests::test_contains: pass -> [missing] (J1)
  • collections::vec_deque::tests::test_reserve_exact: pass -> [missing] (J1)
  • errors::verify_passes_debug_visualizer_placement_79: [missing] -> pass (J1)
  • floats::f128::test_algebraic: pass -> [missing] (J1)
  • fs::tests::file_test_stat_is_correct_on_is_dir: pass -> [missing] (J1)
  • graph::dominators::tests::paper: [missing] -> pass (J1)
  • html::url_parts_builder::tests::push_front_empty: [missing] -> pass (J1)
  • io::tests::take_eof: pass -> [missing] (J1)
  • iter::adapters::map_windows::drop_checks::no_iter_panic_n1: pass -> [missing] (J1)
  • lints::verify_lint_invalid_reference_casting_assign_to_ref_50: [missing] -> pass (J1)
  • num::int_sqrt::i128::isqrt_extended: pass -> [missing] (J1)
  • num::test_try_u32u16: pass -> [missing] (J1)
  • once_lock::get_or_try_init: pass -> [missing] (J1)
  • opaque::tests::test_u8: [missing] -> pass (J1)
  • slice::test_rchunks_exact_remainder: pass -> [missing] (J1)
  • spec::tests::x86_64_unknown_linux_none: [missing] -> pass (J1)
  • str::rsplitn_space_char::short_pile_of_poo: pass -> [missing] (J1)
  • tests::test_unterminated_no_pound: [missing] -> pass (J1)

Stage 2

  • [assembly] tests/assembly/asm/x86-types.rs#i686: pass -> [missing] (J1)
  • [assembly] tests/assembly/targets/targets-elf.rs#aarch64_unknown_fuchsia: pass -> [missing] (J1)
  • [assembly] tests/assembly/targets/targets-elf.rs#aarch64_unknown_redox: pass -> [missing] (J1)
  • [codegen] tests/codegen/float/f16.rs#bit64: pass -> [missing] (J1)
  • [codegen] tests/codegen/issues/issue-126585.rs: pass -> [missing] (J1)
  • [codegen] tests/codegen/meta-filecheck/msvc-prefix-bad.rs: pass -> [missing] (J1)
  • [codegen] tests/codegen/simd-intrinsic/simd-intrinsic-float-log10.rs: pass -> [missing] (J1)
  • [coverage-map] tests/coverage/uses_crate.rs: pass -> [missing] (J1)
  • [debuginfo-gdb] tests/debuginfo/captured-fields-1.rs: pass -> [missing] (J1)
  • [mir-opt] tests/mir-opt/const_prop/tuple_literal_propagation.rs: pass -> [missing] (J1)
  • [mir-opt] tests/mir-opt/coverage/instrument_coverage.rs: pass -> [missing] (J1)
  • [run-make] tests/run-make/linkage-attr-framework: ignore (only executed when the target vendor is Apple) -> [missing] (J1)
  • [run-make] tests/run-make/rlib-format-packed-bundled-libs-3: pass -> [missing] (J1)
  • [rustdoc-js] tests/rustdoc-js/reexport-dedup-macro.rs: pass -> [missing] (J1)
  • [rustdoc] tests/rustdoc/deref-mut-35169-2.rs: pass -> [missing] (J1)
  • [ui] tests/rustdoc-ui/issues/ice-macro-hidden-exported-macro-defid-101076.rs: pass -> [missing] (J1)
  • [ui] tests/rustdoc-ui/rustc-check-passes.rs: pass -> [missing] (J1)
  • [ui] tests/ui-fulldeps/stable-mir/check_trait_queries.rs: pass -> [missing] (J1)
  • [ui] tests/ui/associated-consts/infer-placeholder-in-non-suggestable-pos.rs: pass -> [missing] (J1)
  • [ui] tests/ui/async-await/in-trait/bad-region.rs: pass -> [missing] (J1)
  • [ui] tests/ui/async-await/no-move-across-await-tuple.rs: pass -> [missing] (J1)
  • [ui] tests/ui/borrowck/borrowck-anon-fields-tuple.rs: pass -> [missing] (J1)
  • [ui] tests/ui/closures/2229_closure_analysis/run_pass/move_closure.rs: pass -> [missing] (J1)
  • [ui] tests/ui/coercion/mut-mut-wont-coerce.rs: pass -> [missing] (J1)
  • [ui] tests/ui/const-generics/fn-const-param-infer.rs#adt_const_params: pass -> [missing] (J1)
  • [ui] tests/ui/const-generics/generic_const_exprs/specialization-fuzzing-ice-133639.rs: pass -> [missing] (J1)
  • [ui] tests/ui/consts/const-eval/stable-metric/dominators-edge-case.rs: pass -> [missing] (J1)
  • [ui] tests/ui/consts/underscore_const_names.rs: pass -> [missing] (J1)
  • [ui] tests/ui/debuginfo/windows_gnu_split_debuginfo_packed.rs#x86_64_g: pass -> [missing] (J1)
  • [ui] tests/ui/definition-reachable/private-use.rs: pass -> [missing] (J1)
  • [ui] tests/ui/extern/issue-10025.rs: pass -> [missing] (J1)
  • [ui] tests/ui/feature-gates/feature-gate-cfg-target-has-atomic.rs: pass -> [missing] (J1)
  • [ui] tests/ui/feature-gates/feature-gate-gen_blocks.rs#none: pass -> [missing] (J1)
  • [ui] tests/ui/feature-gates/feature-gate-lang-items.rs: pass -> [missing] (J1)
  • [ui] tests/ui/feature-gates/feature-gate-more-qualified-paths.rs: pass -> [missing] (J1)
  • [ui] tests/ui/higher-ranked/trait-bounds/hrtb-exists-forall-trait-invariant.rs: pass -> [missing] (J1)
  • [ui] tests/ui/impl-trait/defining-use-uncaptured-non-universal-region.rs: pass -> [missing] (J1)
  • [ui] tests/ui/impl-trait/in-trait/span-bug-issue-121457.rs: pass -> [missing] (J1)
  • [ui] tests/ui/issues/issue-20427.rs: pass -> [missing] (J1)
  • [ui] tests/ui/issues/issue-4830.rs: pass -> [missing] (J1)
  • [ui] tests/ui/issues/issue-87707.rs: pass -> [missing] (J1)
  • [ui] tests/ui/lint/unnecessary-extern-crate.rs: pass -> [missing] (J1)
  • [ui] tests/ui/lint/unused/issue-85913.rs: pass -> [missing] (J1)
  • [ui] tests/ui/macros/issue-75982-foreign-macro-weird-mod.rs: pass -> [missing] (J1)
  • [ui] tests/ui/match/dont-highlight-diverging-arms.rs: pass -> [missing] (J1)
  • [ui] tests/ui/methods/method-not-found-but-doc-alias.rs: pass -> [missing] (J1)
  • [ui] tests/ui/mir/issue-68841.rs: pass -> [missing] (J1)
  • [ui] tests/ui/overloaded/overloaded-index.rs: pass -> [missing] (J1)
  • [ui] tests/ui/parser/duplicate-where-clauses.rs: pass -> [missing] (J1)
  • [ui] tests/ui/parser/extern-abi-syntactic.rs: pass -> [missing] (J1)
  • [ui] tests/ui/parser/issues/issue-104620.rs: pass -> [missing] (J1)
  • [ui] tests/ui/parser/keyword-type-as-identifier.rs: pass -> [missing] (J1)
  • [ui] tests/ui/privacy/restricted/lookup-ignores-private.rs: pass -> [missing] (J1)
  • [ui] tests/ui/regions/regions-infer-borrow-scope-within-loop-ok.rs: pass -> [missing] (J1)
  • [ui] tests/ui/resolve/issue-26545.rs: pass -> [missing] (J1)
  • [ui] tests/ui/resolve/shadow-const-param.rs: pass -> [missing] (J1)
  • [ui] tests/ui/return/return-match-array-const.rs: pass -> [missing] (J1)
  • [ui] tests/ui/self/dispatch-from-dyn-zst-transmute.rs: pass -> [missing] (J1)
  • [ui] tests/ui/self/self_type_keyword-2.rs: pass -> [missing] (J1)
  • [ui] tests/ui/statics/static-promotion.rs: pass -> [missing] (J1)
  • [ui] tests/ui/suggestions/fn-to-method-deeply-nested.rs: pass -> [missing] (J1)
  • [ui] tests/ui/suggestions/missing-lifetime-in-assoc-const-type.rs#generic_const_items: pass -> [missing] (J1)
  • [ui] tests/ui/suggestions/suggest-slice-swap.rs: pass -> [missing] (J1)
  • [ui] tests/ui/suggestions/tuple-struct-where-clause-suggestion-91520.rs: pass -> [missing] (J1)
  • [ui] tests/ui/target_modifiers/two_flags.rs#unknown_allowed: pass -> [missing] (J1)
  • [ui] tests/ui/traits/alias/only-require-assocs-from-supertraits.rs: pass -> [missing] (J1)
  • [ui] tests/ui/traits/next-solver/deduce-ty-from-object.rs: pass -> [missing] (J1)
  • [ui] tests/ui/traits/unconstrained-projection-normalization.rs#next: pass -> [missing] (J1)
  • [ui] tests/ui/traits/wf-object/reverse-order.rs: pass -> [missing] (J1)
  • [ui] tests/ui/type-alias-impl-trait/cross_crate_ice.rs: pass -> [missing] (J1)
  • [ui] tests/ui/underscore-lifetime/where-clause-inherent-impl-underscore.rs#rust2018: pass -> [missing] (J1)
  • [ui] tests/ui/unsafe/ranged_ints2_const.rs: pass -> [missing] (J1)
  • [ui] tests/ui/unsized/unsized2.rs: pass -> [missing] (J1)
  • [assembly] tests/assembly/x86_64-cmp.rs#LLVM-20-DEBUG: pass -> [missing] (J2)

(and 31693 additional test diffs)

Additionally, 8657 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 04a67d5a0587ed98632f82c404ae20f9f0a51a1d --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-gnu-llvm-20-1: 5437.7s -> 3912.4s (-28.1%)
  2. dist-x86_64-apple: 8738.0s -> 10897.7s (24.7%)
  3. x86_64-gnu-llvm-19-1: 5520.0s -> 4175.0s (-24.4%)
  4. aarch64-gnu-debug: 4950.7s -> 4035.3s (-18.5%)
  5. aarch64-gnu: 8098.2s -> 6714.8s (-17.1%)
  6. x86_64-apple-1: 8826.6s -> 7727.7s (-12.4%)
  7. aarch64-apple: 4567.5s -> 4117.5s (-9.9%)
  8. dist-aarch64-linux: 5248.6s -> 5623.8s (7.1%)
  9. x86_64-mingw-2: 7622.8s -> 7104.1s (-6.8%)
  10. dist-ohos-aarch64: 4496.4s -> 4773.4s (6.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 (04a67d5): comparison URL.

Overall result: ✅ improvements - 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)
0.1% [0.1%, 0.1%] 2
Improvements ✅
(primary)
-0.2% [-0.2%, -0.1%] 34
Improvements ✅
(secondary)
-0.2% [-0.3%, -0.0%] 19
All ❌✅ (primary) -0.2% [-0.2%, -0.1%] 34

Max RSS (memory usage)

Results (primary 0.4%, secondary 4.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.0% [2.0%, 2.0%] 1
Regressions ❌
(secondary)
6.8% [3.8%, 9.7%] 10
Improvements ✅
(primary)
-1.2% [-1.2%, -1.2%] 1
Improvements ✅
(secondary)
-1.9% [-2.5%, -1.1%] 3
All ❌✅ (primary) 0.4% [-1.2%, 2.0%] 2

Cycles

Results (secondary -2.1%)

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

Binary size

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

Bootstrap: 779.377s -> 778.064s (-0.17%)
Artifact size: 366.47 MiB -> 368.46 MiB (0.54%)

@tgross35 tgross35 deleted the rollup-03gg6lf branch May 28, 2025 13:43
github-actions bot pushed a commit to model-checking/verify-rust-std that referenced this pull request May 30, 2025
Rollup of 8 pull requests

Successful merges:

 - rust-lang#140367 (add `asm_cfg`: `#[cfg(...)]` within `asm!`)
 - rust-lang#140894 (Make check-cfg diagnostics work in `#[doc(cfg(..))]`)
 - rust-lang#141252 (gvn: bail out unavoidable non-ssa locals in repeat)
 - rust-lang#141517 (rustdoc: use descriptive tooltip if doctest is conditionally ignored)
 - rust-lang#141551 (Make two transmute-related MIR lints into HIR lint)
 - rust-lang#141591 (ci: fix llvm test coverage)
 - rust-lang#141647 (Bump master `stage0` compiler)
 - rust-lang#141659 (Add `Result::map_or_default` and `Option::map_or_default`)

r? `@ghost`
`@rustbot` modify labels: rollup
@Mark-Simulacrum
Copy link
Member

Started a build here #141252 (comment) to investigate whether that's the cause of the improvements, but probably no concrete follow-up needed given it's essentially just improvements.

@dianqk
Copy link
Member

dianqk commented Jun 2, 2025

I guess it is #140894. Will I be luckier?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) A-testsuite Area: The testsuite used to check the correctness of rustc 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-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-release Relevant to the release subteam, 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.