Skip to content

Conversation

@ChrisDenton
Copy link
Member

@ChrisDenton ChrisDenton commented Nov 10, 2025

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

aDotInTheVoid and others added 30 commits October 17, 2025 22:09
It belongs here, because it moves from a `rustc_*` type to a
`rustdoc_json_types` type.
The change in this test is minimal, as this is a specific case. The benefits for other cases explained in issue 148070 outweight the change.
```
error: expected a literal (`1u8`, `1.0f32`, `"string"`, etc.) here, found macro `concat`
  --> $DIR/macro-in-attribute.rs:4:21
   |
LL | #[deprecated(note = concat!("a", "b"))]
   |                     ^^^^^^^^^^^^^^^^^ macros are not allowed here
```
and remove unused Steal::get_mut
… Box<dyn Trait>`

```
error[E0310]: the parameter type `R` may not live long enough
  --> $DIR/implicit-static-lifetime-in-dyn-trait-return-type.rs:10:5
   |
LL | fn bb<R>(r: R) -> Box<dyn Foo> {
   |                       ------- this `dyn Trait` has an implicit `'static` lifetime bound
LL |     Box::new(Bar(r))
   |     ^^^^^^^^^^^^^^^^
   |     |
   |     the parameter type `R` must be valid for the static lifetime...
   |     ...so that the type `R` will meet its required lifetime bounds
   |
help: consider adding an explicit lifetime bound
   |
LL | fn bb<R: 'static>(r: R) -> Box<dyn Foo> {
   |        +++++++++
```
Adds missing test coverage for rustdoc's `--test-builder` option.

The existing test only covered the error case (non-executable builder). This PR
adds:
- A custom test builder that logs arguments and forwards to rustc
- A test verifying that `--test-builder` successfully invokes the custom
builder with rustc-style arguments
- Improved comments explaining both the error and success test scenarios

The test validates that custom builders can properly intercept and handle
doctest compilation.

Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com>
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com>
Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com>
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com>
Handle macro invocation in attribute during parse

```
error: expected a literal (`1u8`, `1.0f32`, `"string"`, etc.) here, found macro `concat`
  --> $DIR/macro-in-attribute.rs:4:21
   |
LL | #[deprecated(note = concat!("a", "b"))]
   |                     ^^^^^^^^^^^^^^^^^ macros are not allowed here
```

Fix rust-lang#146325.
rustdoc-json: move `target` to `json::conversions`

It belongs here, because it moves from a `rustc_*` type to a `rustdoc_json_types` type.

r? ```@GuillaumeGomez```
Update substring match for substitutions

Fixed `as_substr` function to check for matching prefixes too. This fixes this issue where `td::s` is matched instead of `std::`. This same behaviour can be seen with `time` and `tokio::time` and similar cases where the error import starts with the same prefix as the suggestion.

```rust
use sync;
fn main() {}
```

```
error[E0432]: unresolved import `sync`
 --> /tmp/test_import.rs:1:5
  |
1 | use sync;
  |     ^^^^ no `sync` in the root
  |
help: consider importing this module instead
  |
1 | use std::sync;
  |      +++++
```

After the changes:

```
error[E0432]: unresolved import `sync`
 --> /tmp/test_import.rs:1:5
  |
1 | use sync;
  |     ^^^^ no `sync` in the root
  |
help: consider importing this module instead
  |
1 | use std::sync;
  |     +++++
```
Add `Steal::risky_hack_borrow_mut`

I'm working on a rustc driver (Creusot) which needs to modify the MIR read by two queries, `mir_borrowck` and `check_liveness`, in different ways for each query. Both of these queries use `mir_promoted` to read the MIR, which is immutable (until it is stolen).

This adds an escape hatch so rustc drivers can mutate MIR for specific queries. And this removes `get_mut` which is unused and also unusable now that there's no way to get a `&mut Steal` from the rustc API.

Another approach may be to override the queries to modify the MIR after having read it from `mir_promoted`. However the implementation of queries is largely hidden, so I can't just copy their code to then modify it. A solution would be to parameterize the queries with callbacks which get instantiated with `mir_promoted` by default, but that seems more involved and ad hoc. That's why I'm proposing this smaller change instead.
rustc_target: hide TargetOptions::vendor

Discussed in rust-lang#148531 (comment).

r? ``@bjorn3``
Fix a typo in the documentation for the strict_shr function

fix: rust-lang#148761
…=yotamofek

[rustdoc] Remove unneeded `allow(rustc::potential_query_instability)`

Originally replaced it with an `expect` and since it failed compilation because it wasn't triggered, I removed it.
fix "is_closure_like" doc comment

Noticed that the [docs](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.TyCtxt.html#method.is_closure_like) stopped in the middle of the sentence. The text exists, but wasn't rendered because it was a regular comment.
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-run-make Area: port run-make Makefiles to rmake.rs A-rustdoc-json Area: Rustdoc JSON backend 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. 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 Nov 10, 2025
@ChrisDenton
Copy link
Member Author

@bors r+ rollup=never p=5

@bors
Copy link
Collaborator

bors commented Nov 10, 2025

📌 Commit 9ad7392 has been approved by ChrisDenton

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 Nov 10, 2025
@rust-log-analyzer
Copy link
Collaborator

The job aarch64-gnu-llvm-20-1 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
To only update this specific test, also pass `--test-args imports/same-prefix-unresolved-import-148070.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/imports/same-prefix-unresolved-import-148070.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/imports/same-prefix-unresolved-import-148070" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
error[E0432]: unresolved import `stat`
##[error]  --> /checkout/tests/ui/imports/same-prefix-unresolved-import-148070.rs:3:5
   |
LL | use stat; //~ ERROR unresolved import `stat`
   |     ^^^^ no `stat` in the root
   |
help: consider importing this struct instead
   |
LL | use std::os::linux::raw::stat; //~ ERROR unresolved import `stat`
   |       +++++++++++++++++++++

error[E0432]: unresolved import `str`
##[error]  --> /checkout/tests/ui/imports/same-prefix-unresolved-import-148070.rs:4:5
   |
LL | use str; //~ ERROR unresolved import `str`
   |     ^^^ no `str` in the root
   |
help: a similar name exists in the module
   |
LL - use str; //~ ERROR unresolved import `str`
LL + use std; //~ ERROR unresolved import `str`
   |
help: consider importing one of these items instead
   |
LL | use std::primitive::str; //~ ERROR unresolved import `str`
   |       ++++++++++++++++
LL | use std::str; //~ ERROR unresolved import `str`
   |       +++++

error[E0432]: unresolved import `sync`
##[error]  --> /checkout/tests/ui/imports/same-prefix-unresolved-import-148070.rs:5:5
   |
LL | use sync; //~ ERROR unresolved import `sync`
   |     ^^^^ no `sync` in the root
   |
help: consider importing this module instead
   |
LL | use std::sync; //~ ERROR unresolved import `sync`
   |      +++++

error: aborting due to 3 previous errors

For more information about this error, try `rustc --explain E0432`.
---

27 LL |     => {}
28    |     ^^
29 
- error: expected a literal (`1u8`, `1.0f32`, `"string"`, etc.) here, found `(`
+ error: expected a literal (`1u8`, `1.0f32`, `"string"`, etc.) here, found expression
31   --> $DIR/cfg_select.rs:70:5
32    |
33 LL |     () => {}

-    |     ^
---
To only update this specific test, also pass `--test-args macros/cfg_select.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/macros/cfg_select.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/macros/cfg_select" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
warning: unreachable predicate
##[warning]  --> /checkout/tests/ui/macros/cfg_select.rs:52:5
   |
---
   |
LL | cfg_select! {}
   | ^^^^^^^^^^^^^^

error: expected a literal (`1u8`, `1.0f32`, `"string"`, etc.) here, found `=>`
##[error]  --> /checkout/tests/ui/macros/cfg_select.rs:65:5
   |
LL |     => {}
   |     ^^

error: expected a literal (`1u8`, `1.0f32`, `"string"`, etc.) here, found expression
##[error]  --> /checkout/tests/ui/macros/cfg_select.rs:70:5
   |
LL |     () => {}
   |     ^^ expressions are not allowed here

---

error[E0539]: malformed `cfg_select` macro input
##[error]  --> /checkout/tests/ui/macros/cfg_select.rs:80:5
   |
LL |     a::b => {}
   |     ^^^^ expected a valid identifier here
   |

error[E0537]: invalid predicate `a`
##[error]  --> /checkout/tests/ui/macros/cfg_select.rs:85:5
   |
LL |     a() => {}
   |     ^^^

error: expected one of `(`, `::`, `=>`, or `=`, found `+`
##[error]  --> /checkout/tests/ui/macros/cfg_select.rs:90:7
   |
LL |     a + 1 => {}
   |       ^ expected one of `(`, `::`, `=>`, or `=`

error: expected one of `(`, `::`, `=>`, or `=`, found `!`
##[error]  --> /checkout/tests/ui/macros/cfg_select.rs:95:8
   |
LL |     cfg!() => {}
   |        ^ expected one of `(`, `::`, `=>`, or `=`

error: aborting due to 9 previous errors; 1 warning emitted

Some errors have detailed explanations: E0537, E0539.
For more information about an error, try `rustc --explain E0537`.
---
To only update this specific test, also pass `--test-args test-attrs/inaccessible-test-modules.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/test-attrs/inaccessible-test-modules.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/test-attrs/inaccessible-test-modules" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers" "--test"
stdout: none
--- stderr -------------------------------
error[E0432]: unresolved import `main`
##[error]  --> /checkout/tests/ui/test-attrs/inaccessible-test-modules.rs:5:5
   |
LL | use main as x; //~ ERROR unresolved import `main`
   |     ^^^^^^^^^ no `main` in the root

error[E0432]: unresolved import `test`
##[error]  --> /checkout/tests/ui/test-attrs/inaccessible-test-modules.rs:6:5
   |
LL | use test as y; //~ ERROR unresolved import `test`
   |     ^^^^^^^^^ no `test` in the root
   |
help: consider importing this module instead
   |
LL | use test::test as y; //~ ERROR unresolved import `test`
   |         ++++++

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0432`.

@ChrisDenton
Copy link
Member Author

@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Nov 10, 2025
@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Nov 10, 2025
@ChrisDenton ChrisDenton deleted the rollup-debxc8j branch November 10, 2025 20:12
@JonathanBrouwer
Copy link
Contributor

Soft conflict between #146579 and #148712

@JonathanBrouwer
Copy link
Contributor

And independently, looks like #148061 is failing or conflicting with something

@ChrisDenton
Copy link
Member Author

Oh right as you were writing that I created a new rollup with just the cfg_select out of those three.

@JonathanBrouwer
Copy link
Contributor

JonathanBrouwer commented Nov 10, 2025

That's also the one I chose so perfect, I r-'ed the other two :)

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

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) A-run-make Area: port run-make Makefiles to rmake.rs A-rustdoc-json Area: Rustdoc JSON backend rollup A PR which is a rollup 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. 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.