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

Lysxia and others added 23 commits November 4, 2025 17:49
and remove unused Steal::get_mut
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: 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>
Required to allow the compiler to build with the debug_refcell stdlib cargo feature.
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.
…llaumeGomez

Add test for --test-builder success path

Fixes rust-lang#148586
…szelmann

Port `cfg_select!` to the new attribute parsing system

Best reviewed commit by commit, since it involves some moving around of code

r? ```@jdonszelmann```
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
…, r=nnethercote

Implement DynSend and DynSync for std::panic::Location.

Allows the compiler to build with the `debug_refcell` stdlib cargo feature.

With `rust.std-features = ["debug_refcell"]` in bootstrap.toml, `./x.py build --stage 2` fails before this patch, and succeeds afterwards.

<details> <summary>error for `./x.py build --stage 2` before this patch</summary>

```Rust
error[E0277]: `NonNull<str>` doesn't implement `DynSync`. Add it to `rustc_data_structures::marker` or use `IntoDynSyncSend` if it's already `Sync`
    --> compiler/rustc_query_system/src/dep_graph/serialized.rs:719:33
     |
 719 |           let results = broadcast(|_| {
     |  _______________________---------_^
     | |                       |
     | |                       required by a bound introduced by this call
 720 | |             let mut local = self.local.borrow_mut();
...    |
 734 | |         });
     | |_________^ within `Location<'static>`, the trait `DynSync` is not implemented for `NonNull<str>`
     |
note: required because it appears within the type `Location<'static>`
    --> /home/zachary/opt_mount/zachary/Programming/rust-compiler-2/library/core/src/panic/location.rs:39:12
     |
  39 | pub struct Location<'a> {
     |            ^^^^^^^^
     = note: required for `&'static Location<'static>` to implement `DynSend`
note: required because it appears within the type `std::option::Option<&'static Location<'static>>`
    --> /home/zachary/opt_mount/zachary/Programming/rust-compiler-2/library/core/src/option.rs:599:10
     |
 599 | pub enum Option<T> {
     |          ^^^^^^
note: required because it appears within the type `std::cell::UnsafeCell<std::option::Option<&'static Location<'static>>>`
    --> /home/zachary/opt_mount/zachary/Programming/rust-compiler-2/library/core/src/cell.rs:2289:12
     |
2289 | pub struct UnsafeCell<T: ?Sized> {
     |            ^^^^^^^^^^
note: required because it appears within the type `Cell<std::option::Option<&'static Location<'static>>>`
    --> /home/zachary/opt_mount/zachary/Programming/rust-compiler-2/library/core/src/cell.rs:313:12
     |
 313 | pub struct Cell<T: ?Sized> {
     |            ^^^^
note: required because it appears within the type `RefCell<LocalEncoderState>`
    --> /home/zachary/opt_mount/zachary/Programming/rust-compiler-2/library/core/src/cell.rs:822:12
     |
 822 | pub struct RefCell<T: ?Sized> {
     |            ^^^^^^^
     = note: required for `rustc_data_structures::sync::WorkerLocal<RefCell<LocalEncoderState>>` to implement `DynSync`
note: required because it appears within the type `EncoderState<D>`
    --> compiler/rustc_query_system/src/dep_graph/serialized.rs:546:8
     |
 546 | struct EncoderState<D: Deps> {
     |        ^^^^^^^^^^^^
     = note: required because it appears within the type `&EncoderState<D>`
note: required because it's used within this closure
    --> compiler/rustc_query_system/src/dep_graph/serialized.rs:719:33
     |
 719 |         let results = broadcast(|_| {
     |                                 ^^^
note: required by a bound in `rustc_data_structures::sync::broadcast`
    --> /home/zachary/opt_mount/zachary/Programming/rust-compiler-2/compiler/rustc_data_structures/src/sync/parallel.rs:239:56
     |
 239 | pub fn broadcast<R: DynSend>(op: impl Fn(usize) -> R + DynSync) -> Vec<R> {
     |                                                        ^^^^^^^ required by this bound in `broadcast`

For more information about this error, try `rustc --explain E0277`.
error: could not compile `rustc_query_system` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
Build completed unsuccessfully in 0:02:04
```

</details>
…=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 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. 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 ed0ccfc 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
@bors
Copy link
Collaborator

bors commented Nov 10, 2025

⌛ Testing commit ed0ccfc with merge d3f6889...

bors added a commit that referenced this pull request Nov 10, 2025
Rollup of 9 pull requests

Successful merges:

 - #148480 (Add `Steal::risky_hack_borrow_mut`)
 - #148608 (Add test for --test-builder success path)
 - #148667 (a few small clippy fixes)
 - #148712 (Port `cfg_select!` to the new attribute parsing system)
 - #148760 (rustc_target: hide TargetOptions::vendor)
 - #148775 (Fix a typo in the documentation for the strict_shr function)
 - #148779 (Implement DynSend and DynSync for std::panic::Location.)
 - #148781 ([rustdoc] Remove unneeded `allow(rustc::potential_query_instability)`)
 - #148791 (fix "is_closure_like" doc comment)

r? `@ghost`
`@rustbot` modify labels: rollup
@ChrisDenton
Copy link
Member Author

ChrisDenton commented Nov 11, 2025

Seems like this got stuck. It's been almost 4.5 hours and hasn't made progress in a long while.

@bors r- retry

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 11, 2025
@ChrisDenton ChrisDenton deleted the rollup-h7d8zbf branch November 11, 2025 23:48
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 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. 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.