Skip to content

Rustc pull update - #2246

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

workflows-stdarch[bot] wants to merge 126 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
bors and others added 12 commits October 9, 2026 13:17
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
…ercote

Avoid double-checking self.bound_vars' len in ValidateBoundVars' TypeVisitor impl

`ValidateBoundVars` has three instances of the following:

```rust
if list.len() <= idx {
    panic!();
}
bound_ty.assert_eq(list.get(idx).unwrap());
```

The length check on `list` ends up being performed twice: once in the function itself and once in the implementation of the `get` method.

Replacing this by a `let-else` allows to ensure that the bound check is done exactly once. This results in IC improvements ranging from -0.26% to -0.08% except 5 benchmarks that end up being +0.05% to +0.08%.

r? nnethercote 
@bors try @rust-timer queue
bors and others added 14 commits October 15, 2026 06:02
compiler-builtins subtree update

Subtree update of `compiler-builtins` to rust-lang/compiler-builtins@c8f734e.

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

r? @ghost
Add bootstrap step to build the TPDE plugin





Adds TPDE steps to build the TPDE plugin on Linux targets and to optionally include it as part of the compiler sysroot for local development. Part of rust-lang/goals#802.

This does not make any effort to be able to use TPDE in the compiler; all it does is stick a dylib in the place where it will eventually be needed.

cc @ZuseZ4

r? Kobzol

---------------

No LLMs were used to write this PR.
…ormat, r=petrochenkov

Fix rmeta-link metadata not being read on AIX

on XCOFF file format the payload goes to `.info` and the writer knows this from the file format 
on the other hand `rmeta_link::read` has no target so it always looks at the named section  which on AIX returns nothing and returns `None`

This PR is the fix so that it checks the format just like the writer does

Note that there is no AIX in CI so I couldn't test it and don't have access to a machine so was not tested locally either
c-variadic: support ppcf128



tracking issue: rust-lang/rust#163323
cc rust-lang/rust#161787

On `powerpc64` this needs a change to lower the alignment of `ppcf128` to only 8 when read from a `VaList`.

On `powerpc` this needs some additional changes to the logic to match GCC. Of course, in clang the ABI of this type is completely broken, we'll see if my fix for that gets merged llvm/llvm-project#225956.
…rtdev

stdarch subtree update

Subtree update of `stdarch` to eb9b302.

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

r? @ghost
…omez

Generate redirect pages for hidden modules

This fixes an intra-doc link, shown in the test case, where the private path gets used as the link target.

Bug was reported [on the unofficial Discord](https://discord.com/channels/273534239310479360/273541522815713281/1561027634681348187).
…onthey

Add more syscall doc aliases to std docs

Some of these are quite trivial but we should optimize for the user not having to think about it.

Blocked on rust-lang/std-dev-guide#64
breakpoint: warn against relying on SIGTRAP aborts

This is mostly based on https://issues.chromium.org/issues/40625592 where Chromium devs report

> Note: on Intel, the debugger breakpoint instruction (int3) is only one
byte, while the fatal termination instruction (ud2) is two bytes.
Unfortunately, crash reports seem to be indicating that int3 is
non-fatal. Since it's important that TRAP_SEQUENCE() terminates, it
cannot rely on int3.

FWIW they seem to also be worried about debugger users
> Make sure it crashes in case a developer steps past the breakpoint

That was 7 years ago, so maybe there's an update we could get somehow -- does anyone have contacts with the Chrome team at Google? That said, looking at the code, they [still have the extra ud2 today](https://github.com/v8/v8/blob/5fe0aa3bc79c0a9d3ad546b79211f07105f09585/src/base/immediate-crash.h#L58).

The code also has a comment saying
```
// TODO(https://crbug.com/958675): In theory, it should be possible to use just
// int3. However, there are a number of crashes with SIGILL as the exception
// code, so it seems likely that there's a signal handler that allows execution
// to continue after SIGTRAP.
```
That link goes to the above bug.

The code also has indications of an unfinished transition
```
// [...] In addition, the int3/bkpt/brk will
// be removed in followups, so splitting it up like this now makes it easy to
// land the followups.
```
That comment was written at least 5 years ago though.

r? @tgross35
Cc @joshtriplett
…rouwer

improve diagnostic for literals in lint attributes

Improves the diagnostic for literals in lint attributes, like `#[allow("meow")]`.

Before:
```
error[E0452]: malformed lint attribute input
 --> main.rs:5:9
  |
5 | #[allow("meow")]
  |         ^^^^^^ bad attribute argument

error[E0452]: malformed lint attribute input
 --> main.rs:8:8
  |
8 | #[deny(1.0)]
  |        ^^^ bad attribute argument
```
After:
```
error: expected path to a lint, found literal
 --> main.rs:5:9
  |
5 | #[allow("meow")]
  |         ^^^^^^ not a lint
  |
  = help: try using `#[allow(meow)]`

error: expected path to a lint, found literal
 --> main.rs:8:8
  |
8 | #[deny(1.0)]
  |        ^^^ not a lint
  |
  = help: for example, write `#[deny(dead_code)]` for `dead_code`
```

Probably easier to review with whitespace changes turned off.

r? JonathanBrouwer
…uwer

Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#164518 (stdarch subtree update)
 - rust-lang/rust#164497 (Generate redirect pages for hidden modules)
 - rust-lang/rust#113891 (Add more syscall doc aliases to std docs)
 - rust-lang/rust#163692 (breakpoint: warn against relying on SIGTRAP aborts)
 - rust-lang/rust#164486 (improve diagnostic for literals in lint attributes)
 - rust-lang/rust#164511 (abort_on_unwind: clarify docs)
This updates the rust-version file to b6eeb93c992027a03e1fd120b6652546396b142c.
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@b6eeb93
Filtered ref: 32f5516
Upstream diff: rust-lang/rust@260f1ac...b6eeb93

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.