Rollup of 9 pull requests#157963
Closed
JonathanBrouwer wants to merge 19 commits into
Closed
Conversation
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
Contributor
Author
Contributor
Contributor
|
⌛ Trying commit 52c1af1 with merge 93fde37… To cancel the try build, run the command 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
Collaborator
|
The job Click to see the possible cause of the failure (guessed by this bot) |
Contributor
|
PR #157788, which is a member of this rollup, was unapproved. This rollup was thus unapproved. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Successful merges:
AliasTy.AliasTerm&UnevaluatedConstto useAlias#156538 (RefactorAliasTy.AliasTerm&UnevaluatedConstto useAlias)T: PartialEqbounds to derivedStructuralPartialEqimpls. #156807 (AddT: PartialEqbounds to derivedStructuralPartialEqimpls.)TryFrom<Vec>for array #155616 (constifyTryFrom<Vec>for array)-Zlint-rust-version#157958 (doc: Document-Zlint-rust-version)r? @ghost
Create a similar rollup