Skip to content

Automatic Rustup - #5614

Merged
RalfJung merged 31 commits into
masterfrom
rustup-2026-11-11
Nov 11, 2026
Merged

RalfJung merged 31 commits into
masterfrom
rustup-2026-11-11

Conversation

@workflows-miri

Copy link
Copy Markdown
Contributor

Merge ref '9c5648833e5c' from rust-lang/rust

Pull recent changes from https://github.com/rust-lang/rust via Josh.

Previous upstream ref: rust-lang/rust@ac8310b
New upstream ref: rust-lang/rust@9c56488
Filtered ref: 012ad42
Upstream diff: rust-lang/rust@ac8310b...9c56488

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

folkertdev and others added 30 commits November 8, 2026 15:33
Without it, reads are reported as UB because the tracking of what bytes are initialized is incorect
remove 'x miri' smoke test from PR CI

This is often the slowest PR CI job, so it's worth speeding it up a little. I added it because `./x miri` uses some... interesting... hacks to get the test crates to compile. But this doesn't seem worth checking pre-bors, it is quite unlikely to break in most PRs.

We do still [run](https://github.com/rust-lang/rust/blob/85110540b5163b34fd13daf633292383458169f9/src/bootstrap/mk/Makefile.in#L62-L91) these commands in bors CI.

Cc @rust-lang/miri
Prepare to make `rustc_trivial_field_reads` usable in user code

Zulip discussion:
[#t-lang > diagnostics attribute to ignore code for unused_code lints](https://rust-lang.zulipchat.com/#narrow/channel/213817-t-lang/topic/diagnostics.20attribute.20to.20ignore.20code.20for.20unused_code.20lints/with/614949580)
[#t-compiler/help > #160621 (Allow ignoring fns for dead code analysis)](https://rust-lang.zulipchat.com/#narrow/channel/182449-t-compiler.2Fhelp/topic/.23160621.20.28Allow.20ignoring.20fns.20for.20dead.20code.20analysis.29/with/629007836)

Open questions I have:
1. Some of the `Debug` impls are not pointed out as usage sites. For example this test:
```rust
#[derive(Debug)]
enum TupleVariant {
    Variant1(i32), //~ ERROR: variant `Variant1` is never constructed
    Variant2,
}

fn main() {
	let _ = TupleVariant::Variant2;
}
```
now loses its the note in the error message:
```
note: `TupleVariant` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
```
but in my mind this also makes sense - the `Debug` impl never constructs that `Variant1` and even if `rustc_trivial_field_reads` is removed from the debug impl, the "variant never constructed" warning would still occur. Note that this doesn't apply to `Clone` impls, which do technically construct that variant although that brings me to point 2

2. If I am reading the code right, the whole point of the `ignored_variant_stack` is to make sure we don't mark a variant of an enum live from within a match arm that matches on that exact enum variant. But isn't that exactly what the `Clone` impl does? The inner match arm of it would look like `Variant1(x) => Variant1(x)`. I looked into `necessary_variants` and found that it directly ignores the kind of variant we encounter, namely `PatKind::TupleStruct(hir::QPath::TypeRelative(...))` but I don't really understand why and whether that's a bug or whether I am missing something
…lmann

`Move` trait feature gate

r? jdonszelmann

Add an unstable feature gate for the `Move` trait to experiment with the implementation, able to be removed at any time.

This pr misses the actual injection of the `Move` trait in all types, so it should not have perf issues (maybe just a check against diesel to be sure).

Mirror of rust-lang/rust#165376 for the related `Forget` trait

Part of rust-lang/rust#161457
Upgrade bundled musl to 1.2.6

This also includes these 3 patches for musl CVEs:
- [CVE-2026-6042]: denial of service in iconv
- [CVE-2026-40200]: qsort stack buffer overflow
- [CVE-2026-107891]: integer overflow in regcomp

The first two were already being applied to our build of musl 1.2.5, the third one is new.

This also adds the patches to the following targets which previously missed them due to using crosstool-ng to build their toolchain:
- loongarch64-unknown-linux-musl
- powerpc64-unknown-linux-musl
- powerpc64le-unknown-linux-musl
- riscv64gc-unknown-linux-musl

[CVE-2026-6042]: https://www.openwall.com/lists/musl/2026/04/03/2
[CVE-2026-40200]: https://www.openwall.com/lists/musl/2026/04/10/3
[CVE-2026-107891]: https://www.openwall.com/lists/musl/2026/10/21/1

r? cuviper
Add enclosing item context when pointing at `FnMut` bound

Ensure that we always show the `fn` (and its enclosing `trait`/`impl` if appropriate) when pointing at an `FnMut` bound:

```
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
  --> $DIR/fnmut-closure-moving-value.rs:11:14
   |
LL | impl Bar {
LL |     fn f<F>(&self, mut f: F)
LL |     where F: FnMut()
   |              ^^^^^^^
```
add `core::arch::{x86, x86_64}::x87_f80`

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

Add `x87_f80` in the same way as `f16b` and `ppcf128`.

---

It's unclear what to do with this type on softfloat targets. Clang and GCC reject the type when the x87 registers are not available. We should do the same, probably just with a `cfg`?

I don't think we have a good `cfg` for this though? `x87` is still set on softfloat  targets, while `soft-float` doesn't get set (that does not give a warning even, it probably should?). We also don't set `cfg_abi`.

### future work

- the ABI of `Complex<x87_f80>` has not yet been implemented
- `x87_f80` does not yet implement `VaArgSafe`
…petrochenkov

Change the span building of paths from first-to-last to chained

Following the work in rust-lang/rust#164165, the paths' spans are now chained instead of merely having a first-to-last scheme.

This alternative span-combining scheme stems from rust-lang/rust#126763.
Instead of `first_tok.to(last_tok)`, we chain everything in the middle.
This is important for contexts inside macros (see altered test).

I believe, however, that this change may lead to some perf regressions, so a perf run here would be great.

r? @petrochenkov
…=folkertdev

fix incorrect byte count suffix on MSVC

fixes rust-lang/rust#165299

this moves the byte count calculation into a shared helper in `rustc_codegen_ssa`. it now derives the count from the original argument layouts rather than the lowered signature.

the fix is wired up for `llvm`. symbols are emitted with a `\x01` prefix so llvm doesn’t decorate them a second time, and the linker-facing symbol naming path now handles the `\x01` and `?` prefixes.

**_testing:_**

verified fastcall, stdcall and vectorcall on msvc, including cross-crate references.
added regression coverage for the linker failure in rust-lang/rust#165299, including a portable `build-pass` test using `minicore` and `rust-lld`. the unpatched compiler fails with a linker error, while the patched compiler links successfully.

added codegen regression tests and updated the existing abi, unwind and assembly tests for the corrected symbol names and byte counts. this also resolves the over-aligned argument `FIXME` in `win32-byte-count-suffix.rs`.

cc @folkertdev @workingjubilee
…it, r=dtolnay

Mark the compile unit for `-Zdebuginfo-for-profiling`

With `-Zdebuginfo-for-profiling`, set `debugInfoForProfiling` on the `DICompileUnit`, as Clang does for `-fdebug-info-for-profiling` (`CGDebugInfo.cpp`). Before this change, the flag only added the discriminators pass, and the compile unit flag was always false.
Remove `backend_optimization_level`.

Turns out that all uses were effectively equivalent to using sess.opts.optimize.

In particular, the output of that function was only ever passed to target_machine_factory, which ignores it on anything but llvm, and on llvm it only passed it to to_llvm_opt_settings, where the difference between Size/SizeMin/More is only the second return value, which is immediately dropped. So replacing all uses of backend_optimization_level with sess.opts.optimize is effectively equivalent.

LLM usage: I asked $LLM to review the commit, and it didn't complain about anything. Also $LLM initially figured out (and I confirmed) that backend_optimization_level was effectively a no-op.
…ilee

fix NumScalableVectors::from_field_count

I assume that this should've been `2..=8` and not `2..8`, based on the comments and `IntoDiagArg` implementation.
Unignore passing GCC backend tests

Since we last checked, a lot more tests now pass with the GCC backend, so unignoring them.

r? @antoyo
miri subtree update

Helps with rust-lang/rust#143166

Subtree update of `miri` to ce0d2f2.

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

r? @ghost
…r=tmiasko

avoid Terminator:None in MIR inliner

Another step towards changing `Option<Terminator>` to `Terminator` in `BasicBlockData`. More info in [this thread](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/vibe.20check.20-.20removing.20Option.20from.20Terminator/with/637588808).

Here we can just avoid `terminator.take`, this function replaces the original terminator and doesn't really need to move it out to get the info it needs. It only needs to `take` the function arguments.
…they

Partially stabilize `ptr_alignment_type` as `alignment_type`

Tracking issue: rust-lang/rust#102070

## Stabilized API

All used to be gated under `ptr_alignment_type`, now stabilized under `alignment_type`:

```rust
// in `core::mem`

#[derive(Copy, Clone, PartialEq, Eq)]
pub struct Alignment { ... }

impl Alignment {
    pub const MIN: Self;
    pub const fn of<T>() -> Self;
    pub const fn of_val<T: ?Sized>(val: &T) -> Self;
    pub const fn of_val_raw<T: ?Sized>(val: *const T) -> Self;
    pub const fn new(align: usize) -> Option<Self>;
    pub const unsafe fn new_unchecked(align: usize) -> Self;
    pub const fn as_usize(self) -> usize;
    pub const fn as_nonzero_usize(self) -> NonZero<usize>;
}

impl Debug for Alignment;
impl TryFrom<NonZero<usize>> for Alignment;
impl TryFrom<usize> for Alignment;
impl From<Alignment> for NonZero<usize>;
impl From<Alignment> for usize;
impl Ord for Alignment;
impl PartialOrd for Alignment;
impl Hash for Alignment;
impl Default for Alignment;
```

## Things *not* getting stabilized
Remains under `ptr_alignment_type` (but with a new tracking issue: rust-lang/rust#165719):

```rust
// in `core::mem`
impl Alignment {
    pub const fn log2(self) -> u32;
    pub const fn mask(self) -> usize;
}

// in `core::layout`
impl Layout {
    // `pub const fn from_size_align(size: usize, align: usize) -> Result<Self, LayoutError>`'s sibling
    pub const fn from_size_alignment(size: usize, alignment: Alignment) -> Result<Self, LayoutError>;
    // `pub const unsafe fn from_size_align_unchecked(size: usize, align: usize) -> Self`'s sibling
    pub const unsafe fn from_size_alignment_unchecked(size: usize, alignment: Alignment) -> Self;
    // `pub const fn align(&self) -> usize`'s sibling
    pub const fn alignment(&self) -> Alignment;
    // `pub const fn align_to(&self, align: usize) -> Result<Self, LayoutError>`'s sibling
    pub const fn adjust_alignment_to(&self, alignment: Alignment) -> Result<Self, LayoutError>;
    // no `align: usize` sibling
    pub const fn padding_needed_for(&self, alignment: Alignment) -> usize;
}
```

Removed:
```rust
// in core::ptr
#[deprecated(note = "moved from `ptr` to `mem`")]
pub type Alignment = mem::Alignment;

// in `core::mem`
impl Alignment {
    #[deprecated(note = "renamed to `as_nonzero_usize`", suggestion = "as_nonzero_usize" )]
    pub const fn as_nonzero(self) -> NonZero<usize> {
        self.as_nonzero_usize()
    }
}
```

### const trait impls

These *are* stabilized as non-const (see "Stabilized APIs"), but `const` counterparts remain unstable under the same feature gates:

#### under `const_convert` (rust-lang/rust#143773)

```rust
impl const TryFrom<NonZero<usize>> for Alignment;
impl const TryFrom<usize> for Alignment;
impl const From<Alignment> for NonZero<usize>;
impl const From<Alignment> for usize;
```

#### under `const_default` (rust-lang/rust#143894).
```rust
impl const Default for Alignment;
```

#### under `const_cmp` (rust-lang/rust#143800).
```rust
impl const PartialOrd for Alignment;
impl const Ord for Alignment;
impl const PartialEq for Alignment;
impl const Eq for Alignment;
```

#### under `const_clone` (rust-lang/rust#142757).
```rust
impl const Clone for Alignment;
```
…sDenton

Windows: fix Dir::remove and Dir::rename following symlinks

Windows `fs::Dir` used to follow symlinks for operations that should instead act on the symlink itself. This fixes that.
Fixes rust-lang/rust#164249

try-job: test-x86_64-msvc*
Cc @ChrisDenton
Add safety requirements for Pattern and Searcher

This PR tries to fix the issue rust-lang/rust#164904 and rust-lang/rust#165076. When I was reviewing the missing safety doc of unsafe trait in std, I found that `ReverseSearcher ` and `Searcher` are not marker trait. They provide safe methods but they are unsafe trait without safety requirements. Then I found these two issues so I tried to fix these.

I open a topic in Zulipchat: [Soundness issue about Pattern and Search](https://rust-lang.zulipchat.com/#narrow/channel/219381-t-libs/topic/Soundness.20issue.20about.20Pattern.20and.20Search/with/638725746).

According to the topic, what I do in this PR are:

1. Adding safety requirements for `Search` and `ReverseSearcher`. Concretely, I imitate the write style of Rust-for-linux(I did many research about the safety doc of Rust-for-linux) by using `Guarantees` to describe that the requirements implementors should follow. It seems that there are duplication(`next_match`, `next_reject`, `next_match_back`, `next_reject_back` share the same guarantees), so it can be improved.
I know this PR can't solve all the problems existed in these two issues because I don't do any change about `Pattern`, which I think is a little tricky issue (Maybe need to talk with t-lib members).
2. Marking `Pattern` as unsafe, and adding safety requirements for `Pattern`. In particularly, I think `Pattern` need to ensure that `[into_searcher](https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html#tymethod.into_searcher)` does return the searcher that search pattern for the given string.
interpret: ensure newly created unions have uninit in their padding

Fixes #5554

r? @oli-obk
Move `check_attr` to attribute parsing

Just cleanup, should not affect behaviour other than diagnostic ordering.

Can be reviewed commit by commit, every commit passes tests.
Is also small enough that reviewing as a whole is fine tho.

r? @mejrs
…Denton

windows: check for null before wide encoding

Only a `\0` byte in an OsStr becomes a WTF16 NUL, so we can check before converting instead of after.

For `to_u16s`, this up to halves the amount of memory being scanned, and it can use the optimized memchr [u8] path.

For `ensure_no_nuls` the same applies, and this additionally skips a duplicated WTF8->WTF16 conversion: all but one call to it is followed by `encode_wide` anyway.
mpsc_sync::stream_send_recv_stress: wait for all threads to finish

rust-lang/rust#156365 did this for the other two queues, but somehow I skipped mpsc_sync.

Best reviewed without whitespace diff.

r? @maxdexh
(very similar to rust-lang/rust#165643)
…-bits, r=clarfonthey

docs(num): remove needless whitespaces

Remove needless whitespaces from the documentation for `int::reverse_bits`.
…uwer

Rollup of 24 pull requests

Successful merges:

 - rust-lang/rust#165709 (remove 'x miri' smoke test from PR CI)
 - rust-lang/rust#164217 (Prepare to make `rustc_trivial_field_reads` usable in user code)
 - rust-lang/rust#165569 (`Move` trait feature gate)
 - rust-lang/rust#165575 (Upgrade bundled musl to 1.2.6)
 - rust-lang/rust#163241 (Add enclosing item context when pointing at `FnMut` bound)
 - rust-lang/rust#163992 (add `core::arch::{x86, x86_64}::x87_f80`)
 - rust-lang/rust#165047 (Change the span building of paths from first-to-last to chained)
 - rust-lang/rust#165458 (fix incorrect byte count suffix on MSVC)
 - rust-lang/rust#165490 (Mark the compile unit for `-Zdebuginfo-for-profiling`)
 - rust-lang/rust#165586 (Remove `backend_optimization_level`.)
 - rust-lang/rust#165646 (fix NumScalableVectors::from_field_count)
 - rust-lang/rust#165655 (Unignore passing GCC backend tests)
 - rust-lang/rust#165740 (miri subtree update)
 - rust-lang/rust#165753 (avoid Terminator:None in MIR inliner)
 - rust-lang/rust#153261 (Partially stabilize `ptr_alignment_type` as `alignment_type`)
 - rust-lang/rust#164559 (Windows: fix Dir::remove and Dir::rename following symlinks)
 - rust-lang/rust#165562 (stop using gce in a test)
 - rust-lang/rust#165681 (Add safety requirements for Pattern and Searcher)
 - rust-lang/rust#165682 (interpret: ensure newly created unions have uninit in their padding)
 - rust-lang/rust#165693 (Move `check_attr` to attribute parsing)
 - rust-lang/rust#165715 (windows: check for null before wide encoding)
 - rust-lang/rust#165717 (mpsc_sync::stream_send_recv_stress: wait for all threads to finish)
 - rust-lang/rust#165733 (docs(num): remove needless whitespaces)
 - rust-lang/rust#165739 (remove NOP File::flush from fs tests)

Failed merges:

 - rust-lang/rust#165727 (Normalize "beta release channel" in `const-supertrait-unstable` test)
 - rust-lang/rust#164218 (Tweak private re-export errors to point at correct span and have more context)
This updates the rust-version file to 9c5648833e5ceb667a708d53c00b83ecc9e610d5.
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Previous upstream ref: rust-lang/rust@ac8310b
New upstream ref: rust-lang/rust@9c56488
Filtered ref: 012ad42
Upstream diff: rust-lang/rust@ac8310b...9c56488

This merge was created using https://github.com/rust-lang/josh-sync.
@rustbot rustbot added the S-waiting-on-review Status: Waiting for a review to complete label Nov 11, 2026
@RalfJung

Copy link
Copy Markdown
Member

Priroda tests failing...

@RalfJung
RalfJung enabled auto-merge November 11, 2026 07:53
@RalfJung
RalfJung added this pull request to the merge queue Nov 11, 2026
Merged via the queue into master with commit 2adf7ba Nov 11, 2026
15 checks passed
@RalfJung
RalfJung deleted the rustup-2026-11-11 branch November 11, 2026 08:45
@rustbot rustbot removed the S-waiting-on-review Status: Waiting for a review to complete label Nov 11, 2026
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.

6 participants