Skip to content

Rollup of 6 pull requests#157461

Closed
jhpratt wants to merge 13 commits into
rust-lang:mainfrom
jhpratt:rollup-kT1saTy
Closed

Rollup of 6 pull requests#157461
jhpratt wants to merge 13 commits into
rust-lang:mainfrom
jhpratt:rollup-kT1saTy

Conversation

@jhpratt
Copy link
Copy Markdown
Member

@jhpratt jhpratt commented Jun 5, 2026

Successful merges:

r? @ghost

Create a similar rollup

sanidhyasin and others added 13 commits June 3, 2026 12:09
These methods return `io::Result` but did not document why they can fail
or, importantly, that a child terminated by a signal is reported through
its `ExitStatus` rather than as an `Err`.

Add `# Errors` sections describing the common reasons spawning a child
can fail (program not found, missing permission, resource exhaustion)
and clarifying that a running child which exits unsuccessfully or is
killed by a signal is not an error: those methods still return `Ok` and
the outcome is reflected in the resulting `ExitStatus`.
…rrow-suggestion, r=mejrs

Suppress E0621 perpetual borrow suggestion

Fixes rust-lang#156682

E0621 suggests `&'a mut Buffer<'a>` when you write `&mut Buffer<'a>` and the compiler wants a named lifetime on the outer reference. That ties both lifetimes together and makes the value unusable after the call. Usually it's not the info that the user actually needs.

When the suggested fix would produce `&'a [mut] T` where `'a` also appears inside `T`, with the changes being implemented on this PR we now suppress the `help:` suggestion and instead emit a `help:` linking to the nomicon's borrow-splitting chapter, which explains the actual fix. Detection uses the pre-fold parameter type and only fires for mutable references, avoiding false positives on trait objects (`&dyn Foo` folds to `&'a (dyn Foo + 'a)`) and shared references (`&'a S<'a>` is often intentional).

What we had before the changes:
```
help: add explicit lifetime `'a` to the type of `buffer`
  |
5 | pub fn foo<'a>(buffer: &'a mut Buffer<'a>) {
  |                         ++
```

What we are going to have now after:
```
error[E0621]: explicit lifetime required in the type of `buffer`
  |
5 |     buffer.buf = &mut buffer.buf[..];
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime `'a` required
  |
  = help: see <https://doc.rust-lang.org/nomicon/borrow-splitting.html> for more
    information about lifetime errors related to mutable references
```
…c, r=wesleywiser

fix armv7a-none-eabihf tier doc

I found that PR rust-lang#146522 promoted `armv7a-none-eabihf` from Tier 3 to Tier 2, updating the target spec, `armv7a-none-eabi.md` and `platform-support.md`, but missed updating `arm-none-eabi.md`. The target remained listed under Tier 3 in that file.

So I move `armv7a-none-eabihf` from Tier 3 to Tier 2 in `arm-none-eabi.md`, merging it with the existing `armv7a-none-eabi` entry.

This makes the documentation consistent with the actual tier in the target spec and `platform-support.md`.

r? @wesleywiser
…-errors, r=LawnGnome

Document error conditions for `Command::{spawn, output, status}`

Fixes rust-lang#150361.

`Command::spawn`, `Command::output`, and `Command::status` all return `io::Result`, but the docs never explain *why* they can fail, and they do not mention the (easy to get wrong) distinction between a failure to spawn and a child that runs but exits unsuccessfully or is killed by a signal.

This adds an `# Errors` section to each method:

- **`spawn`** describes the common reasons spawning fails — the program not being found, lacking permission to execute it (e.g. not executable, or blocked by a policy such as `seccomp`), and the OS being unable to create the process due to resource exhaustion. It also clarifies that an error is only returned for failures *while spawning*; once the child has started, anything that happens to it (including signals) is reported through its `ExitStatus`.
- **`output`** and **`status`** refer back to `spawn` for the spawn failures, and explicitly note that a child which exits unsuccessfully or is terminated by a signal is **not** an error — they still return `Ok`, with the outcome reflected in the resulting `ExitStatus`.

The error conditions and the signal/`ExitStatus` behavior were confirmed by `@bjorn3` in the issue discussion.

Docs-only change; no code blocks were added or modified, and all intra-doc links (`io::Error`, `ExitStatus`, `Output`, `spawn`) follow link patterns already used in this module.

r? libs
…rfonthey,ChrisDenton

std tests: avoid duplicating thread-local machinery

Under `cfg(test)` we have two copies of the standard library loaded, including two copies of all its global variables. Something about how that interacts with rust-lang#148799 results in memory leaks on windows-gnu targets, which are [caught by Miri](https://rust-lang.zulipchat.com/#narrow/channel/269128-miri/topic/Miri.20test-libstd.20Failure.20.282026-06.29/near/599991435).

I'm not sure if it's worth debugging this. It's easier to just avoid duplicating the thread-local machinery.

(This is something we had already done in the past, and then at some point stopped doing as Miri showed no more problems with the duplicate machinery. Now the problems are back.)

Cc @joboet @ChrisDenton
…r-kulst, r=ZuseZ4

NVPTX: Add @kulst to the target maintainers

@kulst is joining me as a `nvptx64-nvidia-cuda` target maintainer 🎆

r? @ZuseZ4
…=mejrs

Make distinction between crate-level attributes that are warned vs errored

r? @mejrs
This is a follow-up to rust-lang#157377 (comment)

This PR makes all unstable crate-level attributes error on incorrect targets.

To make the diff more helpful, I'd recommend reviewing the two commits separately.
* The first commit introduces the infra & makes all crate-level attributes a warning, the commit should have no effect
* The second commit undoes some changes from the first commit, to make all unstable crate-level attributes error
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label Jun 5, 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 Jun 5, 2026
@jhpratt
Copy link
Copy Markdown
Member Author

jhpratt commented Jun 5, 2026

@bors r+ rollup=never p=5

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Jun 5, 2026

📌 Commit a99c4c7 has been approved by jhpratt

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 5, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Jun 5, 2026

⌛ Testing commit a99c4c7 with merge 2bd0a28...

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

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

Successful merges:

 - #156892 (Suppress E0621 perpetual borrow suggestion)
 - #157135 (fix armv7a-none-eabihf tier doc)
 - #157360 (Document error conditions for `Command::{spawn, output, status}`)
 - #157416 (std tests: avoid duplicating thread-local machinery)
 - #157418 (NVPTX: Add @kulst to the target maintainers)
 - #157443 (Make distinction between crate-level attributes that are warned vs errored)
@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 5, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Jun 5, 2026

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

This rollup was thus unapproved.

Auto build was cancelled due to unapproval. Cancelled workflows:

@jhpratt jhpratt closed this Jun 5, 2026
@jhpratt jhpratt deleted the rollup-kT1saTy branch June 5, 2026 06:09
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