Skip to content

Comments

Rollup of 7 pull requests#152986

Merged
rust-bors[bot] merged 19 commits intorust-lang:mainfrom
JonathanBrouwer:rollup-YgdiVyQ
Feb 22, 2026
Merged

Rollup of 7 pull requests#152986
rust-bors[bot] merged 19 commits intorust-lang:mainfrom
JonathanBrouwer:rollup-YgdiVyQ

Conversation

@JonathanBrouwer
Copy link
Contributor

Successful merges:

r? @ghost

Create a similar rollup

LaneAsade and others added 19 commits February 19, 2026 10:07
Otherwise, it systematically fails on:

```
error: process didn't exit successfully: `[...]/rust/build/bootstrap/debug/rustc [...]/rust/build/bootstrap/debug/rustc -vV` (exit status: 127)
--- stderr
[...]/rust/build/x86_64-unknown-linux-gnu/stage1/bin/rustc: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory
```

for us at least.

Signed-off-by: Paul Mabileau <paul.mabileau@harfanglab.fr>
There are six small macros used in `define_callbacks` that all expand to
one thing if a particular query modifier is present, and to another
thing otherwise.

One of these macros looks for the `arena_cache` modifier:
- `query_if_arena`

Two of these macros look for the `return_result_from_ensure_ok`
modifier:
- `query_ensure_select`
- `ensure_ok_result`

Three of these macros look for the `separate_provide_extern` modifier:
- `local_key_if_separate_extern`
- `separate_provide_extern_decl`
- `separate_provide_extern_default`

(There is also `query_helper_param_ty!`, but it follows a different
pattern, and I will deal with it later.)

The "one thing"/"another thing" is different for every macro. For most
of them you can't see at the macro call site what the expansion will be;
you have to look at the macro definition. This is annoying.

This commit reduces the six macros into three macros:
- `if_arena_cache`
- `if_return_result_from_ensure_ok`
- `if_separate_provide_extern`

They all have the same form: they look for a modifier and then expand to
one *given* thing or the other *given* thing. You can see at the call
site the two possible expansions, which is much nicer. (Note:
`query_if_arena` already had this form.)

Ideally there would be a single macro instead of three, but I couldn't
work out a way to combine them.
So that all `$( ... $name ... )*` repetitions are spread across multiple
lines, even if they all fit on one line. I find this much easier to read
because the `$name` repetition is the main feature of these macros.
It doesn't make much sense to put the query doc comments on these
structs. (The doc comments *are* put on various query functions, where
it makes more sense.)
Within `define_callbacks!`:
- Use `Key<'tcx>` where possible instead of `$($K)*`.
- Use `Value<'tcx>` where possible instead of `$V`.

In the other `define_*!` macros:
- Use `$K:ty` where possible instead of `$($K:tt)*`.
- Add comments about unused `$K` and `$V` cases.
- Add `()` key types to the special nodes in the `define_dep_nodes!`
  invocation for consistency with normal queries.
…d of actually showing the content of the subexpression

This meant the content of the subexpression was completely missing from tree view (as the id did not reference anything)
Due to a bug, you can currently use `key` within the `desc` block and
it'll just work regardless of what actual key name you specified. A
subsequent commit will fix this, so let's correct the affected queries
first.
Due to a bug they aren't actually necessary! (A few queries already take
advantage of this, probably unintentionally.) And the next commit will
remove support for explicit `tcx` bindings in favour of implicit.
As currently written, these have big problems.
- `desc` and `cache_on_disk_if` modifiers use different syntaxes to
  introduce `tcx`.
- `desc` is mis-implemented such that the explicit binding isn't even
  necessary and the key name can be botched, as the previous two commits
  showed. (It's the `let (#tcx, #key) = (tcx, key);` line that messes
  things up.)

It's simpler and less error-prone to simply not require explicit `tcx`
bindings, and instead just make it implicitly available to these code
snippets.
Co-authored-by: León Orell Valerian Liehr <me@fmease.dev>
…ry-macros, r=Zalathar

Clarify aspects of query macros

Various clarity and consistency improvements to query macros.

r? @Zalathar
…=oli-obk

`rustc_queries` simplifications

Queries have two ways of specifying code snippets, in `desc` and `cache_on_disk_if` blocks. An example:
```rust
query check_liveness(key: LocalDefId) -> &'tcx rustc_index::bit_set::DenseBitSet<abi::FieldIdx> {
    arena_cache
    desc { |tcx| "checking liveness of variables in `{}`", tcx.def_path_str(key.to_def_id()) }
    cache_on_disk_if(tcx) { tcx.is_typeck_child(key.to_def_id()) }
}
```
If you need to use `tcx` in the snippet, you can use an explicit binding. But there are multiple problems with this.

- The syntax used is different in the two snippets: `|tcx|` within the block vs. `(tcx)` outside the block. (!!)
- Bug 1: In `desc` snippets you can leave out the `|tcx|` and still use `tcx`. Several existing queries do this.
- Bug 2: In `desc` snippets you can always use `key` in the snippet to refer to the key, even if that's not the identifier used in the query head.
- Finally, you can bind `tcx` and not use it, without a warning. Several existing queries do this.

I think explicit `tcx` binding is silly. Many queries need `tcx` and this macro is already super-magical, so just making `tcx` implicitly available seems fine, rather than making the query writer jump through a little syntactic hoop. This makes both the query definitions and the proc macro simpler.

r? @petrochenkov
…, r=BoxyUwU

Feature gate for defaulted associated type_consts with associated_type_defaults

*[View all comments](https://triagebot.infra.rust-lang.org/gh-comments/rust-lang/rust/pull/152385)*

This PR for issue rust-lang#130288 extends a feature gate that was already present for defaulted associated types to defaulted type consts under associated_type_defaults.

Code added:
```
if ctxt == AssocCtxt::Trait && rhs.is_some() {
                    gate!(
                        &self,
                        associated_type_defaults,
                        i.span,
                        "associated type defaults are unstable"
                    );
                }
```

Error produced:
```
error[E0658]: associated type defaults are unstable
  --> $DIR/type-const-associated-default.rs:4:5
   |
LL |     type const N: usize = 10;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: see issue rust-lang#29661 <rust-lang#29661> for more information
   = help: add `#![feature(associated_type_defaults)]` to the crate attributes to enable
   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date

warning: the feature `min_generic_const_args` is incomplete and may not be safe to use and/or cause compiler crashes
  --> $DIR/type-const-associated-default.rs:1:12
   |
LL | #![feature(min_generic_const_args)]
   |            ^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: see issue rust-lang#132980 <rust-lang#132980> for more information
   = note: `#[warn(incomplete_features)]` on by default

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

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

```
Thanks to @BoxyUwU for the guidance on this issue.
….lib, r=clubby789

Build: Add `stdenv.cc.cc.lib` to Nix dependencies

Otherwise, it systematically fails on:

```
error: process didn't exit successfully: `[...]/rust/build/bootstrap/debug/rustc [...]/rust/build/bootstrap/debug/rustc -vV` (exit status: 127)
--- stderr
[...]/rust/build/x86_64-unknown-linux-gnu/stage1/bin/rustc: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory
```

for us at least. Closes rust-lang#127620.

@rustbot label T-bootstrap A-reproducibility
…r=Kobzol

Add build.rustdoc option to bootstrap config

This adds a bootstrap config option `build.rustdoc` to be able to override the stage0 `rustdoc` binary. When unspecified, this defaults to the existing behavior of using the `rustdoc` binary in the same directory as `rustc`, making this a backward-compatible change.

### Motivation

The existing behavior does not seem to be documented and can be surprising. By adding the new option, the behavior gets documented in `bootstrap.example.toml`.

I ran into this because I was experimenting with a build with a configuration like this:
```
build.rustc = "/usr/bin/rustc-1.92"
build.cargo = "/usr/bin/cargo-1.92"
```
This was on Ubuntu where the packages `rustc-1.92` and `cargo-1.92` place symlinks at these locations. This resulted in failure as the bootstrap process tried to run doc tests on `tidy` using a binary `/usr/bin/rustdoc` which did not exist. It took some digging to understand where that path `/usr/bin/rustdoc` was coming from.

@rustbot label +A-bootstrap-config
…ease

Fix ICE when an associated type is wrongly marked as `final`

Fixes: rust-lang#152797.

cc @mu001999 .
…expressions, r=TaKO8Ki

Index expressions rendered the index: subexpression as the id, instea…

…d of actually showing the content of the subexpression

This meant the content of the subexpression was completely missing from tree view (as the id did not reference anything)
@rust-bors rust-bors bot added the rollup A PR which is a rollup label Feb 22, 2026
@rustbot rustbot added A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) PG-exploit-mitigations Project group: Exploit mitigations 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. labels Feb 22, 2026
@JonathanBrouwer
Copy link
Contributor Author

@bors r+ rollup=never p=5

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 22, 2026

📌 Commit 6aa7b31 has been approved by JonathanBrouwer

It is now in the queue for this repository.

@rust-bors rust-bors bot 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 Feb 22, 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 Feb 22, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 22, 2026

☀️ Test successful - CI
Approved by: JonathanBrouwer
Duration: 3h 12m 27s
Pushing c78a294 to main...

@rust-bors rust-bors bot merged commit c78a294 into rust-lang:main Feb 22, 2026
12 checks passed
@rustbot rustbot added this to the 1.95.0 milestone Feb 22, 2026
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#152385 Feature gate for defaulted associated type_consts with asso… 2af7441ecf386d3136ff34fc8966ecfce45f5a0d (link)
#152708 Build: Add stdenv.cc.cc.lib to Nix dependencies 7a08cc70fb34c7f437ab59a7ddadd6772c59a232 (link)
#152779 Clarify aspects of query macros 137fc34422c453d9be3533d875f99ebbacf125ed (link)
#152921 Add build.rustdoc option to bootstrap config a379fb6ea9b93e107b1a89b1d9829c7094d0898c (link)
#152926 Fix ICE when an associated type is wrongly marked as final 7b65a43569ed1428379dca7647ab0a523ccc644a (link)
#152927 Index expressions rendered the index: subexpression as the … 2a71c9459e06940334e8f8277cd4f3a38eea4c43 (link)
#152958 rustc_queries simplifications 7c29d323dd05a490de7b3d981ebdefe0e3cba8a8 (link)

previous master: 1500f0f47f

In the case of a perf regression, run the following command for each PR you suspect might be the cause: @rust-timer build $SHA

@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 1500f0f (parent) -> c78a294 (this PR)

Test differences

Show 200 test diffs

Stage 1

  • [ui] tests/ui/const-generics/mgca/type-const-associated-default.rs: [missing] -> pass (J1)
  • [ui] tests/ui/thir-print/thir-tree-array-index.rs: [missing] -> pass (J1)
  • [ui] tests/ui/traits/final/final-on-assoc-type-const.rs: [missing] -> pass (J1)

Stage 2

  • [ui] tests/ui/const-generics/mgca/type-const-associated-default.rs: [missing] -> pass (J0)
  • [ui] tests/ui/thir-print/thir-tree-array-index.rs: [missing] -> pass (J0)
  • [ui] tests/ui/traits/final/final-on-assoc-type-const.rs: [missing] -> pass (J0)

Additionally, 194 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 c78a29473a68f07012904af11c92ecffa68fcc75 --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. dist-aarch64-llvm-mingw: 1h 27m -> 1h 50m (+25.8%)
  2. x86_64-gnu-tools: 50m 39s -> 1h 1m (+20.7%)
  3. pr-check-1: 27m 27s -> 32m 34s (+18.7%)
  4. x86_64-rust-for-linux: 43m 44s -> 51m 48s (+18.5%)
  5. x86_64-gnu-llvm-20-2: 1h 22m -> 1h 36m (+17.6%)
  6. x86_64-gnu-debug: 1h 46m -> 2h 4m (+16.9%)
  7. dist-aarch64-msvc: 1h 32m -> 1h 47m (+16.2%)
  8. aarch64-gnu-llvm-20-1: 53m 38s -> 1h 1m (+14.4%)
  9. x86_64-gnu-llvm-21-2: 1h 21m -> 1h 33m (+14.3%)
  10. i686-gnu-2: 1h 35m -> 1h 47m (+13.4%)
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 (c78a294): 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 (primary -1.0%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
2.3% [2.3%, 2.3%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.6% [-3.0%, -2.2%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -1.0% [-3.0%, 2.3%] 3

Cycles

Results (primary 2.8%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
2.8% [2.8%, 2.8%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.8% [2.8%, 2.8%] 1

Binary size

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

Bootstrap: 483.037s -> 479.878s (-0.65%)
Artifact size: 397.95 MiB -> 397.87 MiB (-0.02%)

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

Labels

A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) merged-by-bors This PR was explicitly merged by bors. PG-exploit-mitigations Project group: Exploit mitigations rollup A PR which is a rollup 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants