Skip to content

Rustc pull update - #2246

Open
workflows-stdarch[bot] wants to merge 109 commits into
mainfrom
rustc-pull
Open

workflows-stdarch[bot] wants to merge 109 commits into
mainfrom
rustc-pull

Conversation

@workflows-stdarch

Copy link
Copy Markdown

Latest update from rustc.

The rustc-josh-sync Cronjob Bot and others added 30 commits February 16, 2026 04:58
all but one test suite support revisions directive
add chapter on projection vs trait split
projection vs trait bound split cleanup
Document AST lowering implementation
…otif-grp-links

Fix GPU target notification group links
Update neovim instructions for neovim 0.11+
…r/new-features-params

implementing-new-features.md: update parameters to `declare_features!`
Add CI testing instructions for offload
…0505-stage

Fix name of first compiled stage, as stage0 is downloaded
Add docs for non defining vs defining uses in opaque types
JonathanBrouwer and others added 9 commits October 7, 2026 16:44
…eanup-drift, r=PLeVasseur,traviscross

Clean up Reference annotations that drifted

The Reference warns when a `//@ reference:` annotation points to a rule that isn't in the Reference.  Some of these had accumulated. Let's clean them up.

r? @PLeVasseur

cc @DanielEScherzer

(As work within the scope of the lang-docs team, this falls outside the scope of the `forge#1040` policy; nonetheless, I'll note that this work was done with the assistance of AI tools and that this has been prearranged with all reviewers.)
Remove redundant closure in bootstrap

My PR rust-lang/rust#163717 would make Clippy start linting `redundant_closure_for_method_calls` here; let's get ahead of that.

@rustbot label T-bootstrap
@rustbot ready

r? bootstrap
abby DSL: change `where` syntax to `predicates`

Fixes rust-lang/project-assumptions-on-binders#53

The `where` syntax was very confusing, and caused at least one instance of bringing folks up to speed on abby being made more difficult due to the bad syntax:

```rust
core::test_binder_constraints! {
    impl {
        forall<'a, 'b> where 'a: 'b {
            where 'a: 'b
        }
    }
}
```

The two `where` here mean VERY different things. This PR changes the second one to be `predicates`. The name sucks, but Boxy and I bikeshedded for ages and couldn't come up with anything better.

The only reason it was done this way was because the parser has `self.eat_keyword(exp!(Where))` baked into `parse_where_clause_common` and it was vaguely annoying to refactor to reuse it with a different syntax. This PR does the vaguely annoying refactor.

r? @BoxyUwU
Add `synchronization` import lib to windows-gnullvm dist

Fixes rust-lang/rust#163889
Abby test DSL: dont ICE on foralls with unused bound vars

r? @khyperia
…uwer

Rollup of 16 pull requests

Successful merges:

 - rust-lang/rust#163887 (Remove `NonOwner` variant from `AstOwner`)
 - rust-lang/rust#163892 (add revisions for `pass -> [err|ICE]` ui tests `-Znext-solver` )
 - rust-lang/rust#162156 (add IBM f128 type)
 - rust-lang/rust#163925 (Submodule update of rustc-perf)
 - rust-lang/rust#163658 ([PAC] Stop hard coding key and discriminator, consult schema instead)
 - rust-lang/rust#163854 (Include offset in the alignment check when creating ConstValue::Indirect in GVN)
 - rust-lang/rust#163874 (explicitly check for fresh vars in canonicalize)
 - rust-lang/rust#163880 (Don't add pkgs.rustc to PATH in nix dev shell)
 - rust-lang/rust#163893 (Panic on `StableHash` of a `Path` with `GenericArgs`)
 - rust-lang/rust#163894 (revisions for TAIT in env bug)
 - rust-lang/rust#163902 (Clean up Reference annotations that drifted)
 - rust-lang/rust#163905 (Remove redundant closure in bootstrap)
 - rust-lang/rust#163921 (abby DSL: implement ambiguity)
 - rust-lang/rust#163927 (abby DSL: change `where` syntax to `predicates`)
 - rust-lang/rust#163933 (Add `synchronization` import lib to windows-gnullvm dist)
 - rust-lang/rust#163937 (Abby test DSL: dont ICE on foralls with unused bound vars)

> [!WARNING]
> This rollup conflicts with pending auto build #163934 and may need to be recreated if the pending build succeeds.
bootstrap: add bootstrap step to run stdarch-gen checks in CI



This PR ports stdarch-gen checks into the bootstrap test runner as a step, so that we can run the stdarch-gen checks via x.py test.

Changes -:
-> Adds a new `StdarchGenCheck` bootstrap step.
-> Mirrors `https://github.com/rust-lang/stdarch/blob/f71ac102d30d5d1957277cbffc6ba631b67bffd1/.github/workflows/main.yml#L309-L333` (check-stdarch-gen job) 
-> `stdarch-gen-arm` uses a nightly only feature (`#![feature(pattern)]`) but bootstrap's cargo runs on the beta toolchain thus we set `RUSTC_BOOTSTRAP=1` on the child process so it builds.
-> The generators call out to `rustfmt` to format their output so `rustfmt` needs to be on `PATH`. So added bootstrap's rustfmt  to `PATH` before each run. If rustfmt isn't available, the step fails early and tells the user to set `rustfmt = true` in `bootstrap.toml` .

r? @Kobzol
Update cargo submodule



15 commits in f3865b2a4d1acc5276f6b3c67d0e057f4dab3928..29c5daa1afc262323364e039bb70c83372cc702c
2026-09-29 19:58:08 +0000 to 2026-10-07 22:13:48 +0000
- test: mark requiring ssh for tests shelling out to it (rust-lang/cargo#17563)
- chore(deps): update msrv (rust-lang/cargo#17532)
- fix(rustdoc): suppress edition unspecified warnings (rust-lang/cargo#17557)
- chore(deps): update cargo-semver-checks to v0.51.0 (rust-lang/cargo#17553)
- feat(pkgid-spec): Builtin package spec parsing and formatting (rust-lang/cargo#17539)
- feat(hints): support minimum optimization levels (rust-lang/cargo#17368)
- Use trusted publishing for Cargo crates (rust-lang/cargo#17426)
- feat(trim-paths): stabilize `profile.trim-paths` (rust-lang/cargo#17488)
- fix(pkgid): avoid panic on malformed protocol URLs (rust-lang/cargo#17548)
- fix(git)!: Default to net.git-fetch-with-cli if git is present (rust-lang/cargo#17329)
- Improved testsuite file permissions cleanup (rust-lang/cargo#17547)
- docs(guide): Give an example of checking for stale lockfile (rust-lang/cargo#17546)
- Add new peak memory table to cargo timings enabled via `-Zmem-stats` (rust-lang/cargo#17531)
- docs(changlog): Update 1.100.0 to reflect a beta backport (rust-lang/cargo#17542)
- feat(lint): Making the lint name a terminal hyperlink to docs (rust-lang/cargo#17538)
@rustbot

rustbot commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the pull request, and welcome! The Rust Project has assigned @Amanieu (or someone else) to review your changes, you should hear from them (or someone else) within the next two weeks.

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @Amanieu, @adamgemmell, @davidtwco, @folkertdev, @sayantn
  • @Amanieu, @adamgemmell, @davidtwco, @folkertdev, @sayantn expanded to Amanieu, adamgemmell, davidtwco, folkertdev, sayantn
  • Random selection from Amanieu, adamgemmell, davidtwco, folkertdev, sayantn

bors and others added 18 commits October 8, 2026 10:25
…nkov

Use `LocalDefId` as an index in metadata encoding



The goal of this PR to eliminate encoding of a raw `DefIndex`, instead we should encode something (`LocalDefId`) that certainly indicates that index belongs to the local crate. The implementation of `DefIndex` encoding should always panic to prevent accidental remappings of non-local `DefIndex`es in rust-lang/rust#162809. 

So the plan is as follows:

- Use `LocalDefId` as a writing index in tables for metadata encoding, use `LocalDefId` instead of `DefIndex` everywhere, specialize encode/decode methods to correctly process it,
- Replace implementation of `encode_def_index` in `EncodeContext` with panic, so we never remap and encode def index,
- Make tables' keys two-sided: we can read and write using different index types, in this case we will write using `LocalDefId` and read using `DefIndex` (done in rust-lang/rust#163447).

Blocked by rust-lang/rust#162900.

r? @petrochenkov
Upgrade `thin-vec` to 0.2.21, including fix for `.collect()` capacity

This includes mozilla/thin-vec#99 , which makes thin-vec respect size_hint when collecting.

In particular, this causes collections of 1-3 items to not be grown to a capacity of 4. The compiler has a lot of `TinyVec`s in the 1-3 range, so this substantially helps memory, and seems neutral on instructions.

For aws-sdk-ec2 full check, this saves 30.69 MiB max-rss (0.55% of peak RSS).

---

Merging this avoids the need to work around it in other work (e.g. by replacing `.collect()` with something calling `ThinVec::with_capacity(...)` first).
…thercote

Don't store `VecCache::present` when not needed

`VecCache` stores a second set of buckets, `present`, that track the
keys used. This supports simpler iteration over the buckets, when doing
incremental builds, `-Zincremental-verify-ich`, self-profiling, or rustc
debug assertions.

However, when doing a full non-incremental build and *not* doing
verify-ich, self-profiling, or rustc debug assertions, the second set of
buckets are never used, and maintaining them wastes space and
instructions.

Disable that code for that case, and add assertions ensuring `present`
never gets used.

Verifying this requires running a local copy of the perf collector that
does not pass `-Zincremental-verify-ich` on full builds. I ran the
`cargo`, `image`, and `ripgrep` builds locally under both bench and DHAT
profiling, and also ran `aws-sdk-ec2` (1.175.1) as a bench.

aws-sdk-ec2 full check max-rss improved by 62.6 MiB (1.13%).

cargo DHAT peak saved 4.7 MiB (0.74%), max-rss saved 2.6 MiB (0.30%).
image DHAT peak saved 2.3 MiB (1.73%), max-rss saved 1.50 MiB (0.53%).
ripgrep DHAT peak saved 2.02 MiB (3.22%), max-rss saved 1.10 MiB (0.55%).

(Differences in DHAT peak vs max-rss are likely due to allocations vs
actually accessed pages within those allocations. Differences in amount
saved between benchmarks are due to number of queries and number of
buckets needed to hold those queries.)

All of these also improved marginally in instructions executed.
Shrink MIR basic-block statement vectors to fit before caching them

Every MIR basic block allocates a vector for its statements. These statement vectors grow via the usual heuristics, and never get re-shrunk to the correct size for their contents. This holds on to a fair bit of memory.

Shrink them to fit right before we cache them.

For an aws-sdk-ec2 check, this saves ~80 MiB of peak max-RSS (~1.45%), at the cost of 0.3% in instructions.

r? nnethercote
Don't rely on `Global` handing out dangling pointers



This code is incorrect and will leak memory once the global allocator supports zero-sized allocations, since `Box` doesn't deallocate zero-sized layouts
thread::LocalKey: document meaning of 'inner' function argument

rust-lang/rust#92123 gave this function an argument, but without documenting what the argument means or does. I hope I reverse engineered this correctly.

Cc @m-ou-se @joboet
remove redundant unsafe

Related Zulipchat topic link: [Safety requirements of ARM hint APIs](https://rust-lang.zulipchat.com/#narrow/channel/219381-t-libs/topic/Safety.20requirements.20of.20ARM.20hint.20APIs/with/629609101)

This PR tries to remove the unsafe in `core_arch/arm_shared/hint.rs`. As the Zulip topic discussed, these APIs have `#[cfg(any(...))]` attribute to restrict that these can only be compiled when specific architecture is met. So there seems no need to mark these APIs unsafe.

For `__nop`, I found that in `riscv_shared` there exist the same `nop` instruction, but it is marked safe. The concrete path is `core_arch/src/riscv_shared/mod.rs`

```rust
/// Generates the `NOP` instruction
///
/// The NOP instruction does not change any architecturally visible state, except for
/// advancing the `pc` and incrementing any applicable performance counters.
#[inline]
#[unstable(feature = "riscv_ext_intrinsics", issue = "114544")]
pub fn nop() {
    unsafe {
        asm!("nop", options(nomem, nostack, preserves_flags));
    }
}
```

But there is a remaining question: For `wfe` and `wfi`, they can be configurable to trap. So I think if needed, I can complement some discription about trap. Hoping you can give me some suggestion.
Remove indirection for `Expr` in `Body`

While this does not seem to have the measurable perf effect that I hoped, I still think this is nice to merge since it does theoretically remove one pointer dereference anytime a body is visited. I think this has no measurable effect because the `Expr` in the `Body` is allocated right next to the `Body` itself in the arena, so this should always be in L1 cache.

This also works towards making the `Body` type simpler and possibly removing it, as after rust-lang/compiler-team#1044 it won't contain the Parameters anymore. I think we won't end up removing this type though because `BodyId` is a useful concept that is inherently linked to bodies.

I might also take a look if there are other places in the compiler where a similar optimization might have measurable effect.

r? @Kivooeo
rustc-dev-guide subtree update

Subtree update of `rustc-dev-guide` to rust-lang/rustc-dev-guide@7a32071.

Created using https://github.com/rust-lang/josh-sync.

r? @ghost
…uwer

Rollup of 3 pull requests

Successful merges:

 - rust-lang/rust#163918 (remove redundant unsafe)
 - rust-lang/rust#164047 (Remove indirection for `Expr` in `Body`)
 - rust-lang/rust#164154 (rustc-dev-guide subtree update)
fast path for BTreeMap::Iter::next



`BTreeMap::Iter` currently obtains the next kv through leaf navigation even when the next kv is in the same node. This PR adds fast paths for `BTreeMap::Iter` and `BTreeMap::Range`: when advancing does not cross a node boundary, the next edge and kv handle are constructed directly from their indexes.

Result on aarch64:
- map::iteration

benchmark | baseline ns/iter | new ns/iter | change
-- | -- | -- | --
map::iteration_20 | 362.74 ± 3.80 | 116.60 ± 1.46 | -67.9%
map::iteration_1000 | 18743.31 ± 166.97 | 7181.88 ± 91.56 | -61.7%
map::iteration_100000 | 2048028.00 ± 38646.50 | 893023.00 ± 6601.05 | -56.4%
map::iteration_rev_20 | 398.15 ± 6.02 | 111.56 ± 1.24 | -72.0%
map::iteration_rev_1000 | 19650.95 ± 120.38 | 6719.33 ± 33.38 | -65.8%
map::iteration_rev_100000 | 2045171.75 ± 88630.03 | 826631.00 ± 7210.95 | -59.6%
map::iteration_mut_20 | 332.97 ± 3.07 | 116.83 ± 9.19 | -64.9%
map::iteration_mut_1000 | 17282.91 ± 142.66 | 7105.18 ± 64.92 | -58.9%
map::iteration_mut_100000 | 1872307.50 ± 116359.10 | 930589.50 ± 11501.75 | -50.3%
map::iteration_mut_rev_20 | 314.35 ± 5.69 | 99.88 ± 4.46 | -68.2%
map::iteration_mut_rev_1000 | 16153.08 ± 77.67 | 6333.19 ± 9.81 | -60.8%
map::iteration_mut_rev_100000 | 1863366.00 ± 90111.10 | 832836.00 ± 13949.30 | -55.3%

- map::range_iteration

Benchmark | Baseline (ns/iter) | New (ns/iter) | Change
-- | -- | -- | --
map::range_iteration_20 | 380.62 ± 4.55 | 99.54 ± 1.49 | -73.8%
map::range_iteration_1000 | 18,545.75 ± 193.17 | 5,870.29 ± 66.97 | -68.3%
map::range_iteration_100000 | 1,886,226.50 ± 7,167.85 | 606,092.00 ± 5,516.90 | -67.9%
map::range_iteration_rev_20 | 354.25 ± 3.59 | 98.63 ± 4.56 | -72.2%
map::range_iteration_rev_1000 | 16,976.08 ± 186.23 | 5,604.28 ± 104.99 | -67.0%
map::range_iteration_rev_100000 | 1,717,588.50 ± 6,813.65 | 579,875.00 ± 6,914.20 | -66.2%
map::range_iteration_mut_20 | 336.01 ± 14.14 | 94.51 ± 2.88 | -71.9%
map::range_iteration_mut_1000 | 15,517.95 ± 218.64 | 5,095.03 ± 44.77 | -67.2%
map::range_iteration_mut_100000 | 1,604,837.00 ± 12,474.30 | 510,776.50 ± 1,607.21 | -68.2%
map::range_iteration_mut_rev_20 | 293.22 ± 4.60 | 86.87 ± 0.85 | -70.4%
map::range_iteration_mut_rev_1000 | 13,705.48 ± 126.54 | 5,035.34 ± 34.81 | -63.3%
map::range_iteration_mut_rev_100000 | 1,393,440.00 ± 5,983.90 | 517,439.50 ± 4,770.85 | -62.9%

- map::first_and_last

Benchmark | Baseline (ns/iter) | New (ns/iter) | Change
-- | -- | -- | --
map::first_and_last_0_nightly | 21.06 ± 0.44 | 21.05 ± 0.22 | -0.0%
map::first_and_last_0_stable | 42.63 ± 1.34 | 42.53 ± 0.94 | -0.2%
map::first_and_last_100_nightly | 47.77 ± 1.22 | 46.62 ± 0.60 | -2.4%
map::first_and_last_100_stable | 302.27 ± 1.00 | 126.24 ± 4.89 | -58.2%
map::first_and_last_10k_nightly | 73.27 ± 1.01 | 73.22 ± 0.92 | -0.1%
map::first_and_last_10k_stable | 368.89 ± 4.71 | 172.73 ± 2.44 | -53.2%

- set

Benchmark | Baseline (ns/iter) | New (ns/iter) | Change
-- | -- | -- | --
set::difference_random_100_vs_100 | 2,932.50 ± 5.08 | 1,377.14 ± 20.87 | -53.0%
set::difference_random_100_vs_10k | 2,864.22 ± 9.71 | 2,294.26 ± 6.83 | -19.9%
set::difference_random_10k_vs_100 | 193,483.00 ± 1,447.92 | 94,580.40 ± 1,345.45 | -51.1%
set::difference_random_10k_vs_10k | 296,728.67 ± 2,560.70 | 145,264.67 ± 1,775.17 | -51.0%
set::difference_staggered_100_vs_100 | 2,896.54 ± 10.72 | 1,477.26 ± 14.43 | -49.0%
set::difference_staggered_100_vs_10k | 3,443.02 ± 72.13 | 2,715.43 ± 25.13 | -21.1%
set::difference_staggered_10k_vs_10k | 293,658.33 ± 897.93 | 152,474.25 ± 2,005.09 | -48.1%
set::intersection_100_neg_vs_100_pos | 14.39 ± 0.04 | 14.12 ± 0.14 | -1.9%
set::intersection_100_neg_vs_10k_pos | 17.77 ± 0.06 | 17.63 ± 0.06 | -0.8%
set::intersection_100_pos_vs_100_neg | 14.44 ± 0.06 | 13.99 ± 0.14 | -3.1%
set::intersection_100_pos_vs_10k_neg | 17.72 ± 0.22 | 17.38 ± 0.03 | -1.9%
set::intersection_10k_neg_vs_100_pos | 17.21 ± 0.07 | 17.16 ± 0.21 | -0.3%
set::intersection_10k_neg_vs_10k_pos | 19.56 ± 0.11 | 19.38 ± 0.18 | -0.9%
set::intersection_10k_pos_vs_100_neg | 17.08 ± 0.07 | 16.94 ± 0.17 | -0.8%
set::intersection_10k_pos_vs_10k_neg | 19.42 ± 0.05 | 19.20 ± 0.22 | -1.1%
set::intersection_random_100_vs_100 | 2,765.31 ± 19.46 | 1,250.69 ± 7.81 | -54.8%
set::intersection_random_100_vs_10k | 3,149.91 ± 11.38 | 2,536.46 ± 43.26 | -19.5%
set::intersection_random_10k_vs_100 | 3,140.24 ± 40.56 | 2,549.25 ± 46.99 | -18.8%
set::intersection_random_10k_vs_10k | 280,063.67 ± 1,732.87 | 135,042.57 ± 1,463.94 | -51.8%
set::intersection_staggered_100_vs_100 | 2,911.66 ± 21.58 | 1,556.65 ± 19.25 | -46.5%
set::intersection_staggered_100_vs_10k | 3,082.33 ± 6.55 | 2,555.09 ± 18.25 | -17.1%
set::intersection_staggered_10k_vs_10k | 294,074.33 ± 2,705.90 | 164,741.10 ± 650.57 | -44.0%
set::is_subset_100_vs_100 | 2,804.09 ± 6.16 | 1,025.71 ± 9.23 | -63.4%
set::is_subset_100_vs_10k | 2,343.67 ± 21.98 | 1,832.94 ± 30.82 | -21.8%
set::is_subset_10k_vs_100 | 2.35 ± 0.01 | 2.46 ± 0.07 | +4.7%
set::is_subset_10k_vs_10k | 274,705.33 ± 381.00 | 102,497.67 ± 1,043.56 | -62.7%
remove unnecessary char position file lookup for file!()



What this PR does is remove unnecessary computation from the file!() macro. Each invocation performed a general lookup which calculated line and column for each invocation, when all it needs is the file name (the function itself discards the other information).

My few tests (which I can provide if requested, not shown since the change is so trivial) showed on many (1000+ invocations) the compilation speedup is over 10x.
Lint default field values in types with type or const parameters as they won't be evaluated pre-mono



Default field values in types that have const generics are no longer being evaluated until mono. Emit a warn-by-default lint so that API designers are not caught of guard by this behavior.

```
warning: field `multiline_field` has a default value that is only checked when a value of `Z` is constructed
  --> $DIR/field-references-param-accurate-span.rs:9:15
   |
LL |   struct Z<const X: usize> {
LL |       multiline_field:
LL |           ()
LL |               = {
   |  _______________^
LL | |                 f::<X>();
LL | |                 panic!();
LL | |             },
   | |_____________^ this can't be const-evaluated until use
   |
   = help: structs and enums with type and const parameters only evaluate their default field values during construction, not eagerly when declared
   = note: `#[warn(unevaluated_default_field_value)]` on by default
help: if this behavior is acceptable, allow the lint and preferably write a test relying on the default value
   |
LL + #[expect(unevaluated_default_field_value)]
LL | struct Z<const X: usize> {
   |
```

Support `Span` context in lints.

Fixes rust-lang/rust#146496.
Part of rust-lang/rust#132162.
Alternative to rust-lang/rust#163182.

CC @fmease @BoxyUwU
This updates the rust-version file to 03cbd412d98691c83227b65eddadb7b01db4a190.
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Previous upstream ref: rust-lang/rust@260f1ac
New upstream ref: rust-lang/rust@03cbd41
Filtered ref: 4d27969
Upstream diff: rust-lang/rust@260f1ac...03cbd41

This merge was created using https://github.com/rust-lang/josh-sync.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.