Skip to content

Rollup of 11 pull requests #142195

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 30 commits into from

Conversation

workingjubilee
Copy link
Member

@workingjubilee workingjubilee commented Jun 8, 2025

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

workingjubilee and others added 30 commits June 4, 2025 14:51
This test only makes sense if you send it back in time and run it with
a now-old Rust commit, e.g. 50e0cc5
However, if you do go back that far in time, you will see it pass.
And consistently use try_canonicalize rather than canonicalize.
Before this change we had two different ways to attempt to locate the
sysroot which are inconsistently used:
* get_or_default_sysroot which tries to locate based on the 0th cli
  argument and if that doesn't work falls back to locating it using the
  librustc_driver.so location and returns a single path.,
* sysroot_candidates which takes the former and additionally does
  another attempt at locating using librustc_driver.so except without
  linux multiarch handling and then returns both paths.,

The latter was originally introduced to be able to locate the codegen
backend back when cg_llvm was dynamically linked even for a custom
driver when the --sysroot passed in does not contain a copy of cg_llvm.
Back then get_or_default_sysroot did not attempt to locate the sysroot
based on the location of librustc_driver.so yet. Because that is now
done, the only case where removing sysroot_candidates can break things
is if you have a custom driver inside what looks like a sysroot
including the lib/rustlib directory, but which is missing some parts of
the full sysroot like eg rust-lld.
Update this time-traveler on the changes in compiletest and target specs
that they missed over the pass ~3 years by being caught in a time rift.
The aarch64-apple rev splits into itself and aarch64-apple-on, because
rustc obtained support for non-leaf frame-pointers ever since 9b67cba
implemented them and used them in aarch64-apple-darwin's spec.

Note that the aarch64-apple-off revision fails, despite modernization.
This is because 9b67cba also changed the behavior of rustc to defer to
the spec over the command-line interface.
Same reason as it is on Option's.
also adjust the wording a little so that we don't say "the error occurred here" for two different spans
…pointers-favor-the-target-or-cli, r=jieyouxu

Affirm `-Cforce-frame-pointers=off` does not override

This PR exists to document that we (that is, the compiler reviewer) implicitly made a decision in rust-lang#86652 that defies the expectations of some programmers. Some programmers believe `-Cforce-frame-pointers=false` should obey the programmer in all cases, forcing the compiler to avoid generating frame pointers, even if the target specification would indicate they must be generated. However, many targets rely on frame pointers for fast or sound unwinding.

T-compiler had a weekly triage meeting on 2025-05-22. This topic was put to discussion because some programmers may expect the target-overriding behavior. In that meeting we decided removing frame pointers, at least with regards to the contract of the `-Cforce-frame-pointers` option, is not required, even if `=off` is passed, and that we will not do so if the target would expect them. This follows from the documentation here: https://doc.rust-lang.org/rustc/codegen-options/index.html#force-frame-pointers

We may separately pursue trying to clarify the situation more emphatically in our documentation, or warn when people pass the option when it doesn't do anything.
Make NonZero<char> possible

I'd like to use `NonZero<char>` for representing units of CStr in https://github.com/rust-lang/literal-escaper
…r=bjorn3

Atomic intrinsics : use const generic ordering, part 2

This completes what got started in rust-lang#141507 by using a const generic for the ordering for all intrinsics. It is based on that PR; only the last commit is new.

Blocked on:
- rust-lang#141507
- rust-lang#141687
- rust-lang/stdarch#1811
- rust-lang#141964

r? ```@bjorn3```
…oli-obk

const-eval error: always say in which item the error occurred

I don't see why "is this generic" should make a difference. It may be reasonable to key this on whether the error occurs in a `const fn` that was invoked by a const (making it non-obvious which constant it is) vs inside the body of the const.

r? ````@oli-obk````
Add new Tier-3 targets: `loongarch32-unknown-none*`

MCP: rust-lang/compiler-team#865

NOTE: LoongArch32 ELF object support is available starting with object v0.37.0.
…r=petrochenkov

Replace all uses of sysroot_candidates with get_or_default_sysroot

Before this change we had two different ways to attempt to locate the sysroot which are inconsistently used:
* `get_or_default_sysroot` which tries to locate based on the 0th cli argument and if that doesn't work falls back to locating it using the librustc_driver.so location and returns a single path.,
* `sysroot_candidates` which takes the former and additionally does another attempt at locating using `librustc_driver.so` except without linux multiarch handling and then returns both paths.,

The latter was originally introduced to be able to locate the codegen backend back when cg_llvm was dynamically linked even for a custom driver when the `--sysroot` passed in does not contain a copy of cg_llvm. Back then `get_or_default_sysroot` did not attempt to locate the sysroot based on the location of librustc_driver.so yet. Because that is now done, the only case where removing `sysroot_candidates` can break things is if you have a custom driver inside what looks like a sysroot including the `lib/rustlib` directory, but which is missing some parts of the full sysroot like eg rust-lld.

Follow up to rust-lang#138404
…-map, r=jieyouxu

compiler: Add track_caller to AbiMapping::unwrap

Same reason as it is on Option's.
`tests/ui`: A New Order [6/N]

> [!NOTE]
>
> Intermediate commits are intended to help review, but will be squashed prior to merge.

Some `tests/ui/` housekeeping, to trim down number of tests directly under `tests/ui/`. Part of rust-lang#133895.

r? ```@jieyouxu```

auxiliary tag means some changes in realted auxiliary file for test
…iscross

UnsafePinned: update get() docs and signature to allow shared mutation

Follow-up to rust-lang#140638, making `get` consistent with the fact that there's an `UnsafeCell` inside this type now by returning `*mut T` instead of `*const T`.

Cc `@rust-lang/libs-api`
Tracking issue: rust-lang#125735
`tests/ui`: A New Order [7/N]

> [!NOTE]
>
> Intermediate commits are intended to help review, but will be squashed prior to merge.

Some `tests/ui/` housekeeping, to trim down number of tests directly under `tests/ui/`. Part of rust-lang#133895.
… r=workingjubilee

store `target.min_global_align` as an `Align`

Parse the alignment properly when the target is defined/parsed, and error out on invalid alignment values. That means this work doesn't need to happen for every global in each backend.
@rustbot rustbot added A-compiletest Area: The compiletest test runner A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-run-make Area: port run-make Makefiles to rmake.rs A-testsuite Area: The testsuite used to check the correctness of rustc A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic O-linux Operating system: Linux S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Jun 8, 2025
@workingjubilee
Copy link
Member Author

@bors rollup=never r+ p=5

@bors
Copy link
Collaborator

bors commented Jun 8, 2025

📌 Commit 9d824b8 has been approved by workingjubilee

It is now in the queue for this repository.

@bors bors 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 8, 2025
@bors
Copy link
Collaborator

bors commented Jun 8, 2025

⌛ Testing commit 9d824b8 with merge c5445dc...

bors added a commit that referenced this pull request Jun 8, 2025
Rollup of 11 pull requests

Successful merges:

 - #140774 (Affirm `-Cforce-frame-pointers=off` does not override)
 - #141001 (Make NonZero<char> possible)
 - #141700 (Atomic intrinsics : use const generic ordering, part 2)
 - #142008 (const-eval error: always say in which item the error occurred)
 - #142053 (Add new Tier-3 targets: `loongarch32-unknown-none*`)
 - #142089 (Replace all uses of sysroot_candidates with get_or_default_sysroot)
 - #142108 (compiler: Add track_caller to AbiMapping::unwrap)
 - #142132 (`tests/ui`: A New Order [6/N])
 - #142162 (UnsafePinned: update get() docs and signature to allow shared mutation)
 - #142171 (`tests/ui`: A New Order [7/N])
 - #142179 (store `target.min_global_align` as an `Align`)

r? `@ghost`
`@rustbot` modify labels: rollup
@rust-log-analyzer
Copy link
Collaborator

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

Click to see the possible cause of the failure (guessed by this bot)
test [codegen] tests/codegen/zip.rs ... ok

failures:

---- [codegen] tests/codegen/frame-pointer-cli-control.rs#force-on stdout ----

error in revision `force-on`: verification with 'FileCheck' failed
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/ci-llvm/bin/FileCheck" "--input-file" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen/frame-pointer-cli-control.force-on/frame-pointer-cli-control.ll" "/checkout/tests/codegen/frame-pointer-cli-control.rs" "--check-prefix=CHECK" "--check-prefix" "force-on" "--allow-unused-prefixes" "--dump-input-context" "100"
stdout: none
--- stderr -------------------------------
/checkout/tests/codegen/frame-pointer-cli-control.rs:48:11: error: CHECK: expected string not found in input
// CHECK: define i32 @peach{{.*}}[[PEACH_ATTRS:\#[0-9]+]] {
          ^
/checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen/frame-pointer-cli-control.force-on/frame-pointer-cli-control.ll:1:1: note: scanning from here
; ModuleID = 'frame_pointer_cli_control.548cccba3a4a3bc5-cgu.0'
^
/checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen/frame-pointer-cli-control.force-on/frame-pointer-cli-control.ll:7:8: note: possible intended match here
define dso_local i32 @peach(i32 %x) unnamed_addr #0 {
       ^

Input file: /checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen/frame-pointer-cli-control.force-on/frame-pointer-cli-control.ll
Check file: /checkout/tests/codegen/frame-pointer-cli-control.rs

-dump-input=help explains the following input dump.

Input was:
<<<<<<
            1: ; ModuleID = 'frame_pointer_cli_control.548cccba3a4a3bc5-cgu.0' 
check:48'0     X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
            2: source_filename = "frame_pointer_cli_control.548cccba3a4a3bc5-cgu.0" 
check:48'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            3: target datalayout = "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-i128:128-n32:64-S128-ni:1:10:20" 
check:48'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            4: target triple = "wasm32-unknown-wasip1" 
check:48'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            5:  
check:48'0     ~
            6: ; Function Attrs: nounwind uwtable 
check:48'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            7: define dso_local i32 @peach(i32 %x) unnamed_addr #0 { 
check:48'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
check:48'1            ?                                               possible intended match
            8: start: 
check:48'0     ~~~~~~~
            9:  ret i32 %x 
check:48'0     ~~~~~~~~~~~~
           10: } 
check:48'0     ~~
           11:  
check:48'0     ~
           12: attributes #0 = { nounwind uwtable "frame-pointer"="all" "target-cpu"="generic" } 
check:48'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           13:  
check:48'0     ~
           14: !llvm.ident = !{!0} 
check:48'0     ~~~~~~~~~~~~~~~~~~~~
           15:  
check:48'0     ~
           16: !0 = !{!"rustc version 1.89.0-nightly (c5445dcb6 2025-06-08)"} 
check:48'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>>>>>
------------------------------------------



@bors
Copy link
Collaborator

bors commented Jun 8, 2025

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jun 8, 2025
@workingjubilee workingjubilee deleted the rollup-yhkz9am branch June 8, 2025 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-compiletest Area: The compiletest test runner A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-run-make Area: port run-make Makefiles to rmake.rs A-testsuite Area: The testsuite used to check the correctness of rustc A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic O-linux Operating system: Linux rollup A PR which is a rollup S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants