Skip to content

Rollup of 6 pull requests#153919

Merged
rust-bors[bot] merged 18 commits intorust-lang:mainfrom
matthiaskrgr:rollup-UnSAPBk
Mar 15, 2026
Merged

Rollup of 6 pull requests#153919
rust-bors[bot] merged 18 commits intorust-lang:mainfrom
matthiaskrgr:rollup-UnSAPBk

Conversation

@matthiaskrgr
Copy link
Member

Successful merges:

r? @ghost

Create a similar rollup

estebank and others added 18 commits March 14, 2026 20:13
- On `const` and `static` point at the type (like we do for let bindings)
- On fn calls, point at const parameter in fn definition
- On type, point at const parameter in type definition
- On array type lengths, explain that array length is always `usize`
- On enum variant discriminant, mention `repr`
…ers unless going through the type parameter

```
error[E0308]: mismatched types
  --> $DIR/struct-type-parameter-with-default.rs:5:12
   |
LL | struct Foo<T = String> {
   |            ---------- expected this type parameter
LL |     x: T = String::new(),
   |            ^^^^^^^^^^^^^ expected type parameter `T`, found `String`
   |
   = note: expected type parameter `T`
                      found struct `String`
   = note: the type of default fields referencing type parameters can't be assumed inside the struct defining them
```
```
error[E0382]: use of moved value: `foo`
  --> $DIR/as-ref-2.rs:10:14
   |
LL |     let foo = Some(Struct);
   |         --- move occurs because `foo` has type `Option<Struct>`, which does not implement the `Copy` trait
LL |     let _x: Option<Struct> = foo.map(|s| bar(&s));
   |                                  ---------------- `foo` moved due to this method call
LL |     let _y = foo;
   |              ^^^ value used here after move
   |
note: `Option::<T>::map` takes ownership of the receiver `self`, which moves `foo`
  --> $SRC_DIR/core/src/option.rs:LL:COL
help: consider calling `.as_ref()` to borrow the value's contents
   |
LL |     let _x: Option<Struct> = foo.as_ref().map(|s| bar(&s));
   |                                 +++++++++
help: consider calling `.as_mut()` to mutably borrow the value's contents
   |
LL |     let _x: Option<Struct> = foo.as_mut().map(|s| bar(&s));
   |                                 +++++++++
```
Unlike `macro_rules!`, macros-2.0 macros have sensible item-like namespacing
and visibility by default, which avoids the need for `#[macro_export]` and
makes it easier to import the macro.

The tradeoff is having to use `#[rustc_macro_transparency = "semiopaque"]` to
still get macro-rules hygiene, because macros-2.0 hygiene is too strict here.
The function `check_let_chain` was removed previously, but it was still
referenced in a comment in `check_match.rs`. This commit cleans it up.
…match, r=Kivooeo

docs: remove stale reference to `check_let_chain`

This PR removes a stale reference to `check_let_chain` in the documentation of `compiler/rustc_mir_build/src/thir/pattern/check_match.rs`, as the function was previously removed in rust-lang#146832.
Provide more context on type errors in const context

- On `const` and `static` point at the type (like we do for let bindings)
- On fn calls, point at const parameter in fn definition
- On type, point at const parameter in type definition
- On array type lengths, explain that array length is always `usize`
- On enum variant discriminant, mention `repr`
- On default field value using type parameter, provide more context (Fix rust-lang#147748)
…Titor

Turn label into structured suggestion for `.as_ref()` and `.as_mut()`

```
error[E0382]: use of moved value: `foo`
  --> $DIR/as-ref-2.rs:10:14
   |
LL |     let foo = Some(Struct);
   |         --- move occurs because `foo` has type `Option<Struct>`, which does not implement the `Copy` trait
LL |     let _x: Option<Struct> = foo.map(|s| bar(&s));
   |                                  ---------------- `foo` moved due to this method call
LL |     let _y = foo;
   |              ^^^ value used here after move
   |
note: `Option::<T>::map` takes ownership of the receiver `self`, which moves `foo`
  --> $SRC_DIR/core/src/option.rs:LL:COL
help: consider calling `.as_ref()` to borrow the value's contents
   |
LL |     let _x: Option<Struct> = foo.as_ref().map(|s| bar(&s));
   |                                 +++++++++
help: consider calling `.as_mut()` to mutably borrow the value's contents
   |
LL |     let _x: Option<Struct> = foo.as_mut().map(|s| bar(&s));
   |                                 +++++++++
```
Use less `#[macro_use]` in the query system

Macro-rules namespacing and import/export is a bit of a nightmare in general. We can tame it a bit by avoiding `#[macro_use]` as much as possible, and instead putting a `pub(crate) use` after the macro-rules declaration to make the macro importable as a normal item.

I've split this PR into two commits. The first one should hopefully be uncontroversial, while the second commit takes the extra step of declaring `rustc_with_all_queries!` as a macros-2.0 macro, which gives much nicer import/export behaviour, at the expense of having to specify `#[rustc_macro_transparency = "semiopaque"]` to still have access to macro-rules hygiene, because the default macros-2.0 hygiene is too strict here.

There should be no change to compiler behaviour.

---

I stumbled into this while investigating some other changes, such as re-exporting `rustc_middle::query::QueryVTable` or moving the big callback macro out of `rustc_middle::query::plumbing`. I think it makes sense to make this change first, to make other module-juggling tasks easier.

r? nnethercote (or compiler)
… r=Kivooeo

add test for param-env shadowing

Subtle somewhat desirable effect of where-bounds shadowing impls
…bby789

compiletest: show rustdoc logs when `--no-capture`

This should make rustdoc debug log output actually visible in `./x test tests/rustdoc-json/ --no-capture` invocations.

Reported in [#t-infra/bootstrap > Help with &rust-lang#96;./x test --no-capture&rust-lang#96; to get logs.](https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Help.20with.20.60.2E.2Fx.20test.20--no-capture.60.20to.20get.20logs.2E/with/579547276).

### Example

<details>
<summary>Output</summary>

```bash
$ RUSTDOC_LOG=rustdoc::formats::cache=trace ./x test ./tests/rustdoc-json/span.rs --force-rerun --no-capture
[...]

running 1 tests
status: exit status: 0
command: cd "/home/joe/repos/rust/build/x86_64-unknown-linux-gnu/test/rustdoc-json/span" && env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/home/joe/repos/rust/build/x86_64-unknown-linux-gnu/stage1/bin/rustdoc" "-L" "/home/joe/repos/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-L" "/home/joe/repos/rust/build/x86_64-unknown-linux-gnu/test/rustdoc-json/span/auxiliary" "-o" "/home/joe/repos/rust/build/x86_64-unknown-linux-gnu/test/rustdoc-json/span" "--deny" "warnings" "/home/joe/repos/rust/tests/rustdoc-json/span.rs" "-A" "internal_features" "--output-format" "json" "-Zunstable-options"
stdout: none
--- stderr -------------------------------
2:rustc DEBUG rustdoc::formats::cache cx.cache.crate_version=None
2:rustc DEBUG rustdoc::formats::cache folding mod (stripped: false) "Some("span")", id DefId(DefId(0:0 ~ span[c5a1]))
2:rustc DEBUG rustdoc::formats::cache folding mod (stripped: false) "Some("bar")", id DefId(DefId(0:3 ~ span[c5a1]::bar))
------------------------------------------

.

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 177 filtered out; finished in 345.34ms

Build completed successfully in 0:00:02
```
</details>
@rust-bors rust-bors bot added the rollup A PR which is a rollup label Mar 15, 2026
@rustbot rustbot added A-compiletest Area: The compiletest test runner A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) 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-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Mar 15, 2026
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=5

@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 15, 2026

📌 Commit 06dcfe9 has been approved by matthiaskrgr

It is now in the queue for this repository.

@rust-bors rust-bors bot added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Mar 15, 2026
@rust-bors rust-bors bot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 15, 2026
@rust-bors

This comment has been minimized.

@rust-bors rust-bors bot added merged-by-bors This PR was explicitly merged by bors. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Mar 15, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 15, 2026

☀️ Test successful - CI
Approved by: matthiaskrgr
Duration: 3h 10m 39s
Pushing d27207d to main...

@rust-bors rust-bors bot merged commit d27207d into rust-lang:main Mar 15, 2026
12 checks passed
@rustbot rustbot added this to the 1.96.0 milestone Mar 15, 2026
@github-actions
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 f125037 (parent) -> d27207d (this PR)

Test differences

Show 188 test diffs

Stage 1

  • [ui] tests/ui/associated-types/always-applicable-impls-shadowed-in-trait-def.rs#next: [missing] -> pass (J1)
  • [ui] tests/ui/associated-types/always-applicable-impls-shadowed-in-trait-def.rs#old: [missing] -> pass (J1)
  • [ui] tests/ui/structs/default-field-values/struct-type-parameter-with-default.rs: [missing] -> pass (J1)

Stage 2

  • [ui] tests/ui/associated-types/always-applicable-impls-shadowed-in-trait-def.rs#next: [missing] -> pass (J0)
  • [ui] tests/ui/associated-types/always-applicable-impls-shadowed-in-trait-def.rs#old: [missing] -> pass (J0)
  • [ui] tests/ui/structs/default-field-values/struct-type-parameter-with-default.rs: [missing] -> pass (J0)

Additionally, 182 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 d27207d3d64a1399f90344d6ef3c5743204b3fd3 --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. i686-gnu-1: 2h 12m -> 2h 29m (+13.2%)
  2. aarch64-gnu: 2h 17m -> 2h 1m (-11.7%)
  3. optional-x86_64-gnu-parallel-frontend: 2h 47m -> 2h 28m (-11.3%)
  4. dist-various-2: 45m 8s -> 40m 7s (-11.1%)
  5. x86_64-gnu-distcheck: 2h 8m -> 2h 20m (+9.7%)
  6. dist-ohos-armv7: 1h 9m -> 1h 15m (+9.4%)
  7. x86_64-gnu-llvm-21-3: 2h -> 1h 49m (-8.9%)
  8. dist-powerpc64-linux-gnu: 1h 26m -> 1h 34m (+8.6%)
  9. dist-i686-msvc: 2h 21m -> 2h 10m (-8.1%)
  10. aarch64-gnu-llvm-21-1: 58m 7s -> 1h 2m (+6.9%)
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 (d27207d): 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 -1.6%)

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

Cycles

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

Binary size

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

Bootstrap: 479.863s -> 481.726s (0.39%)
Artifact size: 394.80 MiB -> 394.80 MiB (0.00%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-compiletest Area: The compiletest test runner A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) 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 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-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.

8 participants