Skip to content

Rollup of 5 pull requests#156369

Closed
matthiaskrgr wants to merge 12 commits intorust-lang:mainfrom
matthiaskrgr:rollup-HcIYWx8
Closed

Rollup of 5 pull requests#156369
matthiaskrgr wants to merge 12 commits intorust-lang:mainfrom
matthiaskrgr:rollup-HcIYWx8

Conversation

@matthiaskrgr
Copy link
Copy Markdown
Member

Successful merges:

r? @ghost

Create a similar rollup

schneems and others added 12 commits March 2, 2026 14:42
This addition allows an end-user to inspect the environment variables that are visible to the process when it boots.
…use lint

(or more accurately `Result<T, Uninhabited>`/`ControlFlow<Uninhabited, T>`).

This generalizes a previous change where we only did this for `T = ()`.
specifically, do not allow NULL bytes and the empty string
…, r=fee1-dead

Consider `Result<T, Uninhabited>` and `ControlFlow<Uninhabited, T>` to be equivalent to `T` for must use lint

This is an extension to rust-lang#147382.

With this PR `Result<T, Uninhabited>` and `ControlFlow<Uninhabited, T>` considered as must use iif `T` must be used.

For such cases the lint will mention that `T` is wrapped in a `Result`/`ControlFlow` with an uninhabited error/break.

The reasoning here is that `Result<T, Uninhabited>` is equivalent to `T` in which values can be represented and thus the must-used-ness should also be equivalent.

Fixes rust-lang#65861
…s, r=Mark-Simulacrum

Add Command::get_resolved_envs

This addition allows an end-user to inspect the environment variables that are visible to the process when it boots.

Discussed in:

- Tracking issue: rust-lang#149070 (partially closes)
- ACP: rust-lang/libs-team#194
…lacrum

Add regression test for issue 144329

Closes rust-lang#144329.
…r=jdonszelmann

error on empty `export_name`

fixes rust-lang#155495

Using an empty string as the name makes LLVM make up a name. However this name can be inconsistent between compilation units, which is UB and can cause linking errors, and some parts of LLVM just crash on the empty name (see the linked issue).

As far as we know there is only one valid pattern that could use this, a `#[used]` static that is not referenced by the program at all. That is not UB, but the `export_name` is not required for that to work, just normal rust name mangling would do fine.

Technically this is a breaking change, but it seems unlikely that this actually breaks code in the wild that wasn't already broken. I'll leave it up to T-lang to determine what is required here (crater run, FCW, ...), but my gut feeling is that we could just merge this and nobody would notice.
…=mejrs

validate `#[link_name = "..."]` & `#[link(name = "...")]` parameters

fixes rust-lang#155776
fixes rust-lang#155484

specifically, do not allow NULL bytes and the empty string in `#[link_name = "..."]` and `#[link(name = "...")]`.

Like some of the others I think this formally needs to be looked at by T-lang because these errors would not show up if not linking.

The LLVM erorr on `#[linke_name = "\0"]` is emitted here, it is not e.g. target-specific.

https://github.com/llvm/llvm-project/blob/d593279c0b2891f0b0c8af3f70a1a0383b4ad1b5/llvm/lib/IR/Value.cpp#L336-L342

On `#[link(name = "")]` we already error today. A NULL byte in `#[link(name = "\0")]` is caught by the linker (https://godbolt.org/z/vnz9sYbPs), using `#[link_name = ""]` makes LLVM generate a name (https://godbolt.org/z/1hWEo4cxf) which is not useful and likely to cause linker errors.

r? jdonszelmann
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label May 9, 2026
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) 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. labels May 9, 2026
@matthiaskrgr
Copy link
Copy Markdown
Member Author

@bors r+ rollup=never p=5

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 9, 2026

📌 Commit 93c6b09 has been approved by matthiaskrgr

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 May 9, 2026
@rust-bors

This comment has been minimized.

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

Successful merges:

 - #148214 (Consider `Result<T, Uninhabited>` and `ControlFlow<Uninhabited, T>` to be equivalent to `T` for must use lint)
 - #149362 (Add Command::get_resolved_envs)
 - #155188 (Add regression test for issue 144329)
 - #155515 (error on empty `export_name`)
 - #155817 (validate `#[link_name = "..."]` & `#[link(name = "...")]` parameters)
@rust-bors rust-bors Bot 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 May 9, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 9, 2026

💔 Test for 6ebe0bf failed: CI. Failed job:

@rust-log-analyzer
Copy link
Copy Markdown
Collaborator

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

Click to see the possible cause of the failure (guessed by this bot)
fmt: skipped untracked file AWSCLIV2.pkg
fmt: checked 6853 files
tidy check

thread 'deps (.)' (177880) panicked at src/tools/tidy/src/deps.rs:648:24:
cmd.exec() failed with `cargo metadata` exited with an error:     Updating crates.io index
error: failed to get `gccjit` as a dependency of package `rustc_codegen_gcc v0.1.0 (/Users/runner/work/rust/rust/compiler/rustc_codegen_gcc)`

Caused by:
  failed to load source for dependency `gccjit`

Caused by:
  unable to update registry `crates-io`

Caused by:
  download of gc/cj/gccjit failed

Caused by:
  curl failed

Caused by:
---
   4: rust_tidy::main::{closure#1}
   5: std::thread::scoped::scope::<rust_tidy::main::{closure#1}, ()>
   6: rust_tidy::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Command `/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage1-tools-bin/rust-tidy --root-path=/Users/runner/work/rust/rust --cargo-path=/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage0/bin/cargo --output-dir=/Users/runner/work/rust/rust/build --concurrency=3 --npm-path=/Users/runner/.yarn/bin/yarn --ci=true` failed with exit code 101
Created at: src/bootstrap/src/core/build_steps/tool.rs:1618:23
Executed at: src/bootstrap/src/core/build_steps/test.rs:1417:29

--- BACKTRACE vvv
   0: std::backtrace_rs::backtrace::libunwind::trace
             at /rustc/ef0fb8a2563200e322fa4419f09f65a63742038c/library/std/src/../../backtrace/src/backtrace/libunwind.rs:117:9
   1: std::backtrace_rs::backtrace::trace_unsynchronized::<<std::backtrace::Backtrace>::create::{closure#0}>
             at /rustc/ef0fb8a2563200e322fa4419f09f65a63742038c/library/std/src/../../backtrace/src/backtrace/mod.rs:66:14
   2: <std::backtrace::Backtrace>::create
             at /rustc/ef0fb8a2563200e322fa4419f09f65a63742038c/library/std/src/backtrace.rs:331:13
   3: <bootstrap::utils::exec::DeferredCommand>::finish_process
             at ./src/bootstrap/src/utils/exec.rs:939:17
   4: <bootstrap::utils::exec::DeferredCommand>::wait_for_output::<&bootstrap::utils::exec::ExecutionContext>
             at ./src/bootstrap/src/utils/exec.rs:831:21
   5: <bootstrap::utils::exec::ExecutionContext>::run
             at ./src/bootstrap/src/utils/exec.rs:741:45
   6: <bootstrap::utils::exec::BootstrapCommand>::run::<&bootstrap::core::builder::Builder>
             at ./src/bootstrap/src/utils/exec.rs:339:27
   7: <bootstrap::core::build_steps::test::Tidy as bootstrap::core::builder::Step>::run
             at ./src/bootstrap/src/core/build_steps/test.rs:1417:29
   8: <bootstrap::core::builder::Builder>::ensure::<bootstrap::core::build_steps::test::Tidy>
             at ./src/bootstrap/src/core/builder/mod.rs:1595:36
   9: <bootstrap::core::build_steps::test::Tidy as bootstrap::core::builder::Step>::make_run
             at ./src/bootstrap/src/core/build_steps/test.rs:1339:21
  10: <bootstrap::core::builder::StepDescription>::maybe_run
             at ./src/bootstrap/src/core/builder/mod.rs:476:13
  11: bootstrap::core::builder::cli_paths::match_paths_to_steps_and_run
             at ./src/bootstrap/src/core/builder/cli_paths.rs:141:22
  12: <bootstrap::core::builder::Builder>::run_step_descriptions
             at ./src/bootstrap/src/core/builder/mod.rs:1138:9
  13: <bootstrap::core::builder::Builder>::execute_cli
             at ./src/bootstrap/src/core/builder/mod.rs:1117:14
  14: <bootstrap::Build>::build
             at ./src/bootstrap/src/lib.rs:803:25
  15: bootstrap::main
             at ./src/bootstrap/src/bin/main.rs:130:11
  16: <fn() as core::ops::function::FnOnce<()>>::call_once
             at /rustc/ef0fb8a2563200e322fa4419f09f65a63742038c/library/core/src/ops/function.rs:250:5
  17: std::sys::backtrace::__rust_begin_short_backtrace::<fn(), ()>
             at /rustc/ef0fb8a2563200e322fa4419f09f65a63742038c/library/std/src/sys/backtrace.rs:166:18
  18: std::rt::lang_start::<()>::{closure#0}
             at /rustc/ef0fb8a2563200e322fa4419f09f65a63742038c/library/std/src/rt.rs:206:18
  19: <&dyn core::ops::function::Fn<(), Output = i32> + core::marker::Sync + core::panic::unwind_safe::RefUnwindSafe as core::ops::function::FnOnce<()>>::call_once
             at /rustc/ef0fb8a2563200e322fa4419f09f65a63742038c/library/core/src/ops/function.rs:287:21
  20: std::panicking::catch_unwind::do_call::<&dyn core::ops::function::Fn<(), Output = i32> + core::marker::Sync + core::panic::unwind_safe::RefUnwindSafe, i32>
             at /rustc/ef0fb8a2563200e322fa4419f09f65a63742038c/library/std/src/panicking.rs:581:40
  21: std::panicking::catch_unwind::<i32, &dyn core::ops::function::Fn<(), Output = i32> + core::marker::Sync + core::panic::unwind_safe::RefUnwindSafe>
             at /rustc/ef0fb8a2563200e322fa4419f09f65a63742038c/library/std/src/panicking.rs:544:19
  22: std::panic::catch_unwind::<&dyn core::ops::function::Fn<(), Output = i32> + core::marker::Sync + core::panic::unwind_safe::RefUnwindSafe, i32>
             at /rustc/ef0fb8a2563200e322fa4419f09f65a63742038c/library/std/src/panic.rs:359:14
  23: std::rt::lang_start_internal::{closure#0}
             at /rustc/ef0fb8a2563200e322fa4419f09f65a63742038c/library/std/src/rt.rs:175:24
  24: std::panicking::catch_unwind::do_call::<std::rt::lang_start_internal::{closure#0}, isize>
             at /rustc/ef0fb8a2563200e322fa4419f09f65a63742038c/library/std/src/panicking.rs:581:40
---
             at /rustc/ef0fb8a2563200e322fa4419f09f65a63742038c/library/std/src/rt.rs:205:5
  29: _main


Command has failed. Rerun with -v to see more details.
Bootstrap failed while executing `--stage 2 test --host=aarch64-apple-darwin --target=aarch64-apple-darwin`
Build completed unsuccessfully in 0:02:11
  local time: Sat May  9 18:39:04 UTC 2026
  network time: 
##[error]Process completed with exit code 1.

@JonathanBrouwer
Copy link
Copy Markdown
Contributor

Spurious. Closing in favour of larger roll-up

@rust-bors rust-bors Bot added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label May 9, 2026
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 9, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 9, 2026

This pull request was unapproved due to being closed.

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

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants