Skip to content

Rollup of 9 pull requests#157963

Closed
JonathanBrouwer wants to merge 19 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-GCwJw54
Closed

Rollup of 9 pull requests#157963
JonathanBrouwer wants to merge 19 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-GCwJw54

Conversation

@JonathanBrouwer

Copy link
Copy Markdown
Contributor

Successful merges:

r? @ghost

Create a similar rollup

kpreid and others added 19 commits May 25, 2026 16:24
Fixes <rust-lang#147714>.

The changes in `const_to_pat.rs` are entirely to avoid regressing
diagnostic quality, and should not make any difference to what code is
accepted. The change in `compute_applicable_impls_for_diagnostics`
and its callers is entirely to be able to reuse that algorithm for this
purpose.
In rust interger divide by zero is defined to panic, thus the inserted
conditional trap should never trigger as the program should have
panicked if the divisor is zero.

So disable the insertion of the redundant conditional trap.
When passing multiple `-Zsanitizer` flags to the compiler (e.g.,
`-Zsanitizer=address -Zsanitizer=shadow-call-stack`), the options parser
was overwriting the previous values in `target_modifiers` instead of
accumulating them. This resulted in only the last sanitizer being
recorded in the crate metadata's target modifiers, even though the
frontend correctly enabled all of them.

The only way to provide multiple sanitizers was to combine them into a
comma-separated list passed to a single `-Zsanitizer=` flag, but this
does not fit well into the GN build system where different targets may
pass different combinations of sanitizer flags.

Consequently, this caused spurious "incompatible target modifiers"
ABI mismatch errors when linking against dependencies compiled with
accumulated flags (e.g., `-Zsanitizer=address,shadow-call-stack`).

Fix this by entry-modifying the `target_modifiers` map to accumulate
the sanitizers as a comma-separated list when the option is
`sanitizer`.

Also add a codegen test verifying that both CFI and SafeStack
attributes/metadata are present when enabled together via multiple
flags.

Test: ./x.py test tests/codegen-llvm/sanitizer/multiple-sanitizers.rs
Co-authored-by: Jesus Checa <101630491+jchecahi@users.noreply.github.com>
…bjorn3

export symbols: support macos/windows(32/64)

Previously, in the pr rust-lang#150992 , export symbols only supported Linux. The special prefix and suffix rules for some symbols in macOS and Windows were not fully supported. This pull request attempts to clarify these rules and add corresponding support.

Currently, the `undecorate_c_symbol()` function has been added to handle macOS `_` prefixes, Windows x86 calling convention modifiers (cdecl/stdcall/fastcall/vectorcall), and Arm64EC `#` prefixes.

*Update: Handling of Windows C++ mangled symbols has now been added(Linux/macOS don't need).

r? @bjorn3 @petrochenkov
…liasTerm, r=lcnr

Refactor `AliasTy`. `AliasTerm` & `UnevaluatedConst` to use `Alias`

Refactors `AliasTy`, `AliasTerm` & `UnevaluatedConst` to use `Alias`.

Part of rust-lang#156181

r? @lcnr
Add `T: PartialEq` bounds to derived `StructuralPartialEq` impls.

Fixes <rust-lang#147714>.

This is a breaking change to fix a bug, so it will need a crater run if it is to be done at all.

The changes in `const_to_pat.rs` are entirely to avoid regressing diagnostic quality, and should not make any difference to what code is accepted. The changes in `compute_applicable_impls_for_diagnostics` and its callers are entirely to be able to reuse that algorithm for this purpose.

@rustbot label +T-lang
…-symbols, r=petrochenkov

Staticlib rename internal symbols

Follow-up to rust-lang#155338.

`-Zstaticlib-rename-internal-symbols` appends a crate-specific suffix (`_rs{StableCrateId}`) to non-exported symbols, resolving duplicate symbol conflicts when linking multiple Rust staticlibs into the same binary.

The implementation collects all defined `GLOBAL/WEAK` symbol names not in the exported set across all .o files, then renames them by extending the strtab and patching symbol name offsets. When combined with `-Zstaticlib-hide-internal-symbols`, the renamed symbols also receive `STV_HIDDEN` visibility.

Supported on ELF targets (Linux, BSD, etc.) and Apple targets (macOS, iOS, etc.). On unsupported targets (Windows), a warning is emitted and the flag has no effect.

r?@bjorn3 @petrochenkov
… r=petrochenkov

Accumulate multiple -Zsanitizer target modifiers

When passing multiple `-Zsanitizer` flags to the compiler (e.g., `-Zsanitizer=address -Zsanitizer=shadow-call-stack`), the options parser was overwriting the previous values in `target_modifiers` instead of accumulating them. This resulted in only the last sanitizer being recorded in the crate metadata's target modifiers, even though the frontend correctly enabled all of them. The only way to provide multiple sanitizers is to combine them into a comma-separated list passed to a single `-Zsanitizer=` flag, but this doesn't fit very well into the GN build system where different targets may pass different combinations of sanitizer flags.

Consequently, this caused spurious "incompatible target modifiers" ABI mismatch errors when linking against dependencies compiled with accumulated flags.

Fix this by entry-modifying the `target_modifiers` map to accumulate the sanitizers as a comma-separated list when the option is `sanitizer`.
…-vec, r=oli-obk

constify `TryFrom<Vec>` for array

Related issues rust-lang#79597, rust-lang#143773, rust-lang#133214

this makes `Vec` `const Destruct` along the way.
…80, r=lcnr

diagnostics: point to coroutine body on higher-ranked auto trait errors

Fixes rust-lang#155880

When encountering a higher-ranked auto trait bound error involving a coroutine or async function,the trait solver previously used the span of the outermost cause (eg. `spawn(...)` or `is_send(...)`).

This PR modifies the `TraitPlaceholderMismatch` formatting logic to walk down the `ObligationCauseCode` chain.If the obligation originates from a `ty::Coroutine` or `ty::CoroutineWitness`, it extracts that specific span, providing a much more accurate underline for the user.

#### Before:
```text
error: implementation of `Send` is not general enough
  --> src/main.rs:25:5
   |
25 |     is_send(outer())
   |     ^^^^^^^^^^^^^^^^ implementation of `Send` is not general enough
```

#### After:
```text
error: implementation of `Send` is not general enough
  --> src/main.rs:13:74
   |
13 |   async fn inner<'a, T: Trait + 'a>(_: T, x: T::Assoc<'a>) -> T::Assoc<'a> {
   |  __________________________________________________________________________^
14 | |     std::future::ready(x).await
15 | | }
   | |_^ implementation of `Send` is not general enough
```
…=folkertdev

mips: set llvm_args -mno-check-zero-division for all mips targets

In rust interger divide by zero is defined to panic, thus the inserted conditional trap should never trigger as the program should have panicked if the divisor is zero.

So disable the insertion of the redundant conditional trap.
…=JonathanBrouwer

doc: Document `-Zlint-rust-version`

Followup to rust-lang#157707
Tracking issue: rust-lang#157574

r? JonathanBrouwer
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label Jun 16, 2026
@rustbot rustbot added A-run-make Area: port run-make Makefiles to rmake.rs PG-exploit-mitigations Project group: Exploit mitigations 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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Jun 16, 2026
@JonathanBrouwer

Copy link
Copy Markdown
Contributor Author

@bors r+ rollup=never p=5

Trying commonly failed jobs
@bors try jobs=dist-various-1,test-various,x86_64-gnu-aux,x86_64-gnu-llvm-21-3,x86_64-msvc-1,aarch64-apple,x86_64-mingw-1,i686-msvc-2

@rust-bors

rust-bors Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 52c1af1 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 Jun 16, 2026
@rust-bors

rust-bors Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

⌛ Trying commit 52c1af1 with merge 93fde37

To cancel the try build, run the command @bors try cancel.

Workflow: https://github.com/rust-lang/rust/actions/runs/27618125248

rust-bors Bot pushed a commit that referenced this pull request Jun 16, 2026
Rollup of 9 pull requests


try-job: dist-various-1
try-job: test-various
try-job: x86_64-gnu-aux
try-job: x86_64-gnu-llvm-21-3
try-job: x86_64-msvc-1
try-job: aarch64-apple
try-job: x86_64-mingw-1
try-job: i686-msvc-2
@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job test-various failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
test [assembly] tests/assembly-llvm/manual-eq-efficient.rs ... ignored, only executed when the architecture is x86_64
test [assembly] tests/assembly-llvm/dwarf4.rs ... ok
test [assembly] tests/assembly-llvm/dwarf5.rs ... ok
test [assembly] tests/assembly-llvm/loongarch-float-struct-abi.rs ... ok
test [assembly] tests/assembly-llvm/mips-div-no-trap.rs#TRAP ... ok
test [assembly] tests/assembly-llvm/mips-div-no-trap.rs#mips-mti-none-elf ... ok
test [assembly] tests/assembly-llvm/mips-div-no-trap.rs#mips-unknown-linux-gnu ... ok
test [assembly] tests/assembly-llvm/mips-div-no-trap.rs#mips-unknown-linux-musl ... ok
test [assembly] tests/assembly-llvm/mips-div-no-trap.rs#mips-unknown-linux-uclibc ... ok
test [assembly] tests/assembly-llvm/mips-div-no-trap.rs#mips64-openwrt-linux-musl ... ok
test [assembly] tests/assembly-llvm/mips-div-no-trap.rs#mips64-unknown-linux-gnuabi64 ... ok
test [assembly] tests/assembly-llvm/mips-div-no-trap.rs#mips64-unknown-linux-muslabi64 ... ok
test [assembly] tests/assembly-llvm/mips-div-no-trap.rs#mips64el-unknown-linux-gnuabi64 ... ok
test [assembly] tests/assembly-llvm/mips-div-no-trap.rs#mips64el-unknown-linux-muslabi64 ... ok
test [assembly] tests/assembly-llvm/mips-div-no-trap.rs#mipsel-mti-none-elf ... ok
test [assembly] tests/assembly-llvm/mips-div-no-trap.rs#mipsel-sony-psp ... ok
test [assembly] tests/assembly-llvm/mips-div-no-trap.rs#mipsel-sony-psx ... ok
test [assembly] tests/assembly-llvm/mips-div-no-trap.rs#mipsel-unknown-linux-gnu ... ok
test [assembly] tests/assembly-llvm/mips-div-no-trap.rs#mipsel-unknown-linux-musl ... ok
test [assembly] tests/assembly-llvm/mips-div-no-trap.rs#mipsel-unknown-linux-uclibc ... ok
test [assembly] tests/assembly-llvm/mips-div-no-trap.rs#mipsel-unknown-netbsd ... ok
test [assembly] tests/assembly-llvm/mips-div-no-trap.rs#mipsel-unknown-none ... ok
test [assembly] tests/assembly-llvm/mips-div-no-trap.rs#mipsisa32r6-unknown-linux-gnu ... ok
test [assembly] tests/assembly-llvm/naked-functions/aarch64-naked-fn-no-bti-prolog.rs ... ignored, only executed when the architecture is aarch64
test [assembly] tests/assembly-llvm/mips-div-no-trap.rs#mipsisa64r6-unknown-linux-gnuabi64 ... ok
test [assembly] tests/assembly-llvm/mips-div-no-trap.rs#mipsisa32r6el-unknown-linux-gnu ... ok
test [assembly] tests/assembly-llvm/mips-div-no-trap.rs#mipsisa64r6el-unknown-linux-gnuabi64 ... ok
test [assembly] tests/assembly-llvm/naked-functions/aix.rs#aix ... ok
test [assembly] tests/assembly-llvm/naked-functions/function-sections.rs#linux-x86-gnu-fs-false ... ok
test [assembly] tests/assembly-llvm/naked-functions/aix.rs#elfv1-be ... ok
test [assembly] tests/assembly-llvm/naked-functions/function-sections.rs#linux-x86-gnu-fs-true ... ok
test [assembly] tests/assembly-llvm/naked-functions/function-sections.rs#macos-aarch64-fs-false ... ok
---
test [assembly] tests/assembly-llvm/manual-eq-efficient.rs ... ignored, only executed when the architecture is x86_64
test [assembly] tests/assembly-llvm/dwarf4.rs ... ok
test [assembly] tests/assembly-llvm/dwarf5.rs ... ok
test [assembly] tests/assembly-llvm/loongarch-float-struct-abi.rs ... ok
test [assembly] tests/assembly-llvm/mips-div-no-trap.rs#TRAP ... ok
test [assembly] tests/assembly-llvm/mips-div-no-trap.rs#mips-mti-none-elf ... ok
test [assembly] tests/assembly-llvm/mips-div-no-trap.rs#mips-unknown-linux-gnu ... ok
test [assembly] tests/assembly-llvm/mips-div-no-trap.rs#mips-unknown-linux-musl ... ok
test [assembly] tests/assembly-llvm/mips-div-no-trap.rs#mips-unknown-linux-uclibc ... ok
test [assembly] tests/assembly-llvm/mips-div-no-trap.rs#mips64-openwrt-linux-musl ... ok
test [assembly] tests/assembly-llvm/mips-div-no-trap.rs#mips64-unknown-linux-muslabi64 ... ok
test [assembly] tests/assembly-llvm/mips-div-no-trap.rs#mips64-unknown-linux-gnuabi64 ... ok
test [assembly] tests/assembly-llvm/mips-div-no-trap.rs#mips64el-unknown-linux-gnuabi64 ... ok
test [assembly] tests/assembly-llvm/mips-div-no-trap.rs#mips64el-unknown-linux-muslabi64 ... ok
test [assembly] tests/assembly-llvm/mips-div-no-trap.rs#mipsel-sony-psp ... ok
test [assembly] tests/assembly-llvm/mips-div-no-trap.rs#mipsel-mti-none-elf ... ok
test [assembly] tests/assembly-llvm/mips-div-no-trap.rs#mipsel-sony-psx ... ok
test [assembly] tests/assembly-llvm/mips-div-no-trap.rs#mipsel-unknown-linux-gnu ... ok
test [assembly] tests/assembly-llvm/mips-div-no-trap.rs#mipsel-unknown-linux-musl ... ok
test [assembly] tests/assembly-llvm/mips-div-no-trap.rs#mipsel-unknown-linux-uclibc ... ok
test [assembly] tests/assembly-llvm/mips-div-no-trap.rs#mipsel-unknown-netbsd ... ok
test [assembly] tests/assembly-llvm/mips-div-no-trap.rs#mipsel-unknown-none ... ok
test [assembly] tests/assembly-llvm/mips-div-no-trap.rs#mipsisa32r6el-unknown-linux-gnu ... ok
test [assembly] tests/assembly-llvm/naked-functions/aarch64-naked-fn-no-bti-prolog.rs ... ignored, only executed when the architecture is aarch64
test [assembly] tests/assembly-llvm/mips-div-no-trap.rs#mipsisa32r6-unknown-linux-gnu ... ok
test [assembly] tests/assembly-llvm/mips-div-no-trap.rs#mipsisa64r6-unknown-linux-gnuabi64 ... ok
test [assembly] tests/assembly-llvm/naked-functions/aix.rs#aix ... ok
test [assembly] tests/assembly-llvm/naked-functions/aix.rs#elfv1-be ... ok
test [assembly] tests/assembly-llvm/mips-div-no-trap.rs#mipsisa64r6el-unknown-linux-gnuabi64 ... ok
test [assembly] tests/assembly-llvm/naked-functions/function-sections.rs#linux-x86-gnu-fs-false ... ok
test [assembly] tests/assembly-llvm/naked-functions/function-sections.rs#linux-x86-gnu-fs-true ... ok
---

---- [codegen] tests/codegen-llvm/sanitizer/multiple-sanitizers.rs stdout ----
------rustc stdout------------------------------

------rustc stderr------------------------------
error: safestack sanitizer is not supported for this target

error: sanitizer is incompatible with statically linked libc, disable it using `-C target-feature=-crt-static`

error: aborting due to 2 previous errors


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

error: compilation failed!
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/codegen-llvm/sanitizer/multiple-sanitizers.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-musl" "--check-cfg" "cfg(test,FALSE)" "-O" "-Cdebug-assertions=no" "-Zcodegen-source-order" "--emit" "llvm-ir" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen-llvm/sanitizer/multiple-sanitizers/multiple-sanitizers.ll" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Clinker=x86_64-linux-musl-gcc" "-Zsanitizer=cfi" "-Zsanitizer=safestack" "-Clto" "-Ccodegen-units=1" "-C" "unsafe-allow-abi-mismatch=sanitizer"
stdout: none
--- stderr -------------------------------
error: safestack sanitizer is not supported for this target

error: sanitizer is incompatible with statically linked libc, disable it using `-C target-feature=-crt-static`

error: aborting due to 2 previous errors
------------------------------------------

---- [codegen] tests/codegen-llvm/sanitizer/multiple-sanitizers.rs stdout end ----

@rust-bors rust-bors Bot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jun 16, 2026
@rust-bors

rust-bors Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

PR #157788, which is a member of this rollup, was unapproved.

This rollup was thus unapproved.

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

Labels

A-run-make Area: port run-make Makefiles to rmake.rs PG-exploit-mitigations Project group: Exploit mitigations rollup A PR which is a rollup S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)

Projects

None yet

Development

Successfully merging this pull request may close these issues.