Skip to content

Replace -Zon-broken-pipe=... with Externally Implementable Item #[std::io::on_broken_pipe] - #150591

Draft
Enselic wants to merge 1 commit into
rust-lang:mainfrom
Enselic:add-on_broken_pipe
Draft

Replace -Zon-broken-pipe=... with Externally Implementable Item #[std::io::on_broken_pipe]#150591
Enselic wants to merge 1 commit into
rust-lang:mainfrom
Enselic:add-on_broken_pipe

Conversation

@Enselic

@EnselicEnselic commented Jan 2, 2026

Copy link
Copy Markdown
Member

Currently (2026-05-18) Blocked On

We need to make tests/run-make/broken-pipe-no-ice/rmake.rs pass. I and others think we know what the problem is, but it is not easy to fix. TODO: File a detailed and separate issue (maybe).

Previously Blocked On

Tracking Issues:

@rustbotrustbot added 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. labels Jan 2, 2026
@EnselicEnselic changed the title Add on broken pipeAdd initial #![feature(on_broken_pipe)] codeJan 2, 2026
@rust-log-analyzer

This comment has been minimized.

@Enselic
Enselicforce-pushed the add-on_broken_pipe branch 2 times, most recently from 5825fb6 to 7b52018CompareJanuary 5, 2026 21:46
@rustbotrustbot added A-compiletest Area: The compiletest test runner A-run-make Area: port run-make Makefiles to rmake.rs A-testsuite Area: The testsuite used to check the correctness of rustc O-unix Operating system: Unix-like T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Jan 5, 2026
@EnselicEnselic changed the title Add initial #![feature(on_broken_pipe)] codeReplace -Zon-broken-pipe=... with Externally Implementable Item #[std::io::on_broken_pipe() -> std::io::OnBrokenPipeJan 5, 2026
@EnselicEnselic changed the title Replace -Zon-broken-pipe=... with Externally Implementable Item #[std::io::on_broken_pipe() -> std::io::OnBrokenPipeReplace -Zon-broken-pipe=... with Externally Implementable Item #[std::io::on_broken_pipe]Jan 5, 2026
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

Comment threadsrc/tools/miri/src/shims/foreign_items.rs Outdated
Kobzol added a commit to Kobzol/rust that referenced this pull request Jan 7, 2026
rustc book: fix grammar
It was added in ddee45e ([here](https://github.com/rust-lang/rust/pull/97802/changes#diff-85dc642a7bdad363a9e37d2491230280fcd977391ba7a242bda2da9ddb55f654) to be specific) when SIGPIPE was controlled with an attribute on `fn main()` which meant it could also be combined with `#[rustc_main]`:
#[unix_sigpipe = "sig_dfl"]
#[rustc_main]
fn rustc_main() {
The test stopped being needed in cde0cde when `#[unix_sigpipe = "..."]` was replaced by `-Zon-broken-pipe=...`. And it will not be needed when `-Zon-broken-pipe=...` is replaced by an Externally Implementable Item (see rust-lang#150591). Let's remove this test.
Tracking issue:
- rust-lang#150588
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jan 8, 2026
tests/ui/runtime/on-broken-pipe/with-rustc_main.rs: Not needed so remove
It was added in ddee45e ([here](https://github.com/rust-lang/rust/pull/97802/changes#diff-85dc642a7bdad363a9e37d2491230280fcd977391ba7a242bda2da9ddb55f654) to be specific) when SIGPIPE was controlled with an attribute on `fn main()` which meant it could also be combined with `#[rustc_main]`:
#[unix_sigpipe = "sig_dfl"]
#[rustc_main]
fn rustc_main() {
The test stopped being needed in cde0cde when `#[unix_sigpipe = "..."]` was replaced by `-Zon-broken-pipe=...`. And it will not be needed when `-Zon-broken-pipe=...` is replaced by an Externally Implementable Item (see rust-lang#150591). Let's remove this test.
Tracking issue:
- rust-lang#150588
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jan 8, 2026
tests/ui/runtime/on-broken-pipe/with-rustc_main.rs: Not needed so remove
It was added in ddee45e ([here](https://github.com/rust-lang/rust/pull/97802/changes#diff-85dc642a7bdad363a9e37d2491230280fcd977391ba7a242bda2da9ddb55f654) to be specific) when SIGPIPE was controlled with an attribute on `fn main()` which meant it could also be combined with `#[rustc_main]`:
#[unix_sigpipe = "sig_dfl"]
#[rustc_main]
fn rustc_main() {
The test stopped being needed in cde0cde when `#[unix_sigpipe = "..."]` was replaced by `-Zon-broken-pipe=...`. And it will not be needed when `-Zon-broken-pipe=...` is replaced by an Externally Implementable Item (see rust-lang#150591). Let's remove this test.
Tracking issue:
- rust-lang#150588
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jan 8, 2026
tests/ui/runtime/on-broken-pipe/with-rustc_main.rs: Not needed so remove
It was added in ddee45e ([here](https://github.com/rust-lang/rust/pull/97802/changes#diff-85dc642a7bdad363a9e37d2491230280fcd977391ba7a242bda2da9ddb55f654) to be specific) when SIGPIPE was controlled with an attribute on `fn main()` which meant it could also be combined with `#[rustc_main]`:
#[unix_sigpipe = "sig_dfl"]
#[rustc_main]
fn rustc_main() {
The test stopped being needed in cde0cde when `#[unix_sigpipe = "..."]` was replaced by `-Zon-broken-pipe=...`. And it will not be needed when `-Zon-broken-pipe=...` is replaced by an Externally Implementable Item (see rust-lang#150591). Let's remove this test.
Tracking issue:
- rust-lang#150588
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jan 8, 2026
Fix `alloc_error_handler` signature mismatch
It was added in ddee45e ([here](https://github.com/rust-lang/rust/pull/97802/changes#diff-85dc642a7bdad363a9e37d2491230280fcd977391ba7a242bda2da9ddb55f654) to be specific) when SIGPIPE was controlled with an attribute on `fn main()` which meant it could also be combined with `#[rustc_main]`:
#[unix_sigpipe = "sig_dfl"]
#[rustc_main]
fn rustc_main() {
The test stopped being needed in cde0cde when `#[unix_sigpipe = "..."]` was replaced by `-Zon-broken-pipe=...`. And it will not be needed when `-Zon-broken-pipe=...` is replaced by an Externally Implementable Item (see rust-lang#150591). Let's remove this test.
Tracking issue:
- rust-lang#150588
rust-timer added a commit that referenced this pull request Jan 8, 2026
Rollup merge of #150757 - rm-unneded-test, r=bjorn3
Fix `alloc_error_handler` signature mismatch
It was added in ddee45e ([here](https://github.com/rust-lang/rust/pull/97802/changes#diff-85dc642a7bdad363a9e37d2491230280fcd977391ba7a242bda2da9ddb55f654) to be specific) when SIGPIPE was controlled with an attribute on `fn main()` which meant it could also be combined with `#[rustc_main]`:
#[unix_sigpipe = "sig_dfl"]
#[rustc_main]
fn rustc_main() {
The test stopped being needed in cde0cde when `#[unix_sigpipe = "..."]` was replaced by `-Zon-broken-pipe=...`. And it will not be needed when `-Zon-broken-pipe=...` is replaced by an Externally Implementable Item (see #150591). Let's remove this test.
Tracking issue:
- #150588
@rust-bors

This comment has been minimized.

jhpratt added a commit to jhpratt/rust that referenced this pull request Feb 3, 2026
…mic-v2, r=jdonszelmann
compiletest: Don't assume `aux-crate` becomes a `*.so` with `no-prefer-dynamic`
Since it does not make sense to do so. If someone prefers no dynamic stuff, the last thing they want to look for is an .so file. Also add a regression test. Without the fix, the test fails with:
error: test compilation failed although it shouldn't!
--- stderr -------------------------------
error: extern location for no_prefer_dynamic_lib does not exist: .../auxiliary/libno_prefer_dynamic_lib.so
--> .../no-prefer-dynamic-means-no-so.rs:9:5
|
LL | no_prefer_dynamic_lib::return_42();
| ^^^^^^^^^^^^^^^^^^^^^
### Needed by:
- rust-lang#150591 because of rust-lang#151271. But IMHO this PR makes sense on its own.
### Must wait for:
- [x] rust-lang#151695
jhpratt added a commit to jhpratt/rust that referenced this pull request Feb 3, 2026
…mic-v2, r=jdonszelmann
compiletest: Don't assume `aux-crate` becomes a `*.so` with `no-prefer-dynamic`
Since it does not make sense to do so. If someone prefers no dynamic stuff, the last thing they want to look for is an .so file. Also add a regression test. Without the fix, the test fails with:
error: test compilation failed although it shouldn't!
--- stderr -------------------------------
error: extern location for no_prefer_dynamic_lib does not exist: .../auxiliary/libno_prefer_dynamic_lib.so
--> .../no-prefer-dynamic-means-no-so.rs:9:5
|
LL | no_prefer_dynamic_lib::return_42();
| ^^^^^^^^^^^^^^^^^^^^^
### Needed by:
- rust-lang#150591 because of rust-lang#151271. But IMHO this PR makes sense on its own.
### Must wait for:
- [x] rust-lang#151695
Zalathar added a commit to Zalathar/rust that referenced this pull request Feb 3, 2026
…mic-v2, r=jdonszelmann
compiletest: Don't assume `aux-crate` becomes a `*.so` with `no-prefer-dynamic`
Since it does not make sense to do so. If someone prefers no dynamic stuff, the last thing they want to look for is an .so file. Also add a regression test. Without the fix, the test fails with:
error: test compilation failed although it shouldn't!
--- stderr -------------------------------
error: extern location for no_prefer_dynamic_lib does not exist: .../auxiliary/libno_prefer_dynamic_lib.so
--> .../no-prefer-dynamic-means-no-so.rs:9:5
|
LL | no_prefer_dynamic_lib::return_42();
| ^^^^^^^^^^^^^^^^^^^^^
### Needed by:
- rust-lang#150591 because of rust-lang#151271. But IMHO this PR makes sense on its own.
### Must wait for:
- [x] rust-lang#151695
rust-timer added a commit that referenced this pull request Feb 3, 2026
Rollup merge of #151691 - Enselic:dylib-only-for-prefer-dynamic-v2, r=jdonszelmann
compiletest: Don't assume `aux-crate` becomes a `*.so` with `no-prefer-dynamic`
Since it does not make sense to do so. If someone prefers no dynamic stuff, the last thing they want to look for is an .so file. Also add a regression test. Without the fix, the test fails with:
error: test compilation failed although it shouldn't!
--- stderr -------------------------------
error: extern location for no_prefer_dynamic_lib does not exist: .../auxiliary/libno_prefer_dynamic_lib.so
--> .../no-prefer-dynamic-means-no-so.rs:9:5
|
LL | no_prefer_dynamic_lib::return_42();
| ^^^^^^^^^^^^^^^^^^^^^
### Needed by:
- #150591 because of #151271. But IMHO this PR makes sense on its own.
### Must wait for:
- [x] #151695
github-actionsBot pushed a commit to rust-lang/compiler-builtins that referenced this pull request Feb 3, 2026
…=jdonszelmann
compiletest: Don't assume `aux-crate` becomes a `*.so` with `no-prefer-dynamic`
Since it does not make sense to do so. If someone prefers no dynamic stuff, the last thing they want to look for is an .so file. Also add a regression test. Without the fix, the test fails with:
error: test compilation failed although it shouldn't!
--- stderr -------------------------------
error: extern location for no_prefer_dynamic_lib does not exist: .../auxiliary/libno_prefer_dynamic_lib.so
--> .../no-prefer-dynamic-means-no-so.rs:9:5
|
LL | no_prefer_dynamic_lib::return_42();
| ^^^^^^^^^^^^^^^^^^^^^
### Needed by:
- rust-lang/rust#150591 because of rust-lang/rust#151271. But IMHO this PR makes sense on its own.
### Must wait for:
- [x] rust-lang/rust#151695
@rustbotrustbot added the A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. label Feb 3, 2026
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

github-actionsBot pushed a commit to rust-lang/miri that referenced this pull request Feb 4, 2026
…=jdonszelmann
compiletest: Don't assume `aux-crate` becomes a `*.so` with `no-prefer-dynamic`
Since it does not make sense to do so. If someone prefers no dynamic stuff, the last thing they want to look for is an .so file. Also add a regression test. Without the fix, the test fails with:
error: test compilation failed although it shouldn't!
--- stderr -------------------------------
error: extern location for no_prefer_dynamic_lib does not exist: .../auxiliary/libno_prefer_dynamic_lib.so
--> .../no-prefer-dynamic-means-no-so.rs:9:5
|
LL | no_prefer_dynamic_lib::return_42();
| ^^^^^^^^^^^^^^^^^^^^^
### Needed by:
- rust-lang/rust#150591 because of rust-lang/rust#151271. But IMHO this PR makes sense on its own.
### Must wait for:
- [x] rust-lang/rust#151695
github-actionsBot pushed a commit to rust-lang/rust-analyzer that referenced this pull request Feb 5, 2026
…=jdonszelmann
compiletest: Don't assume `aux-crate` becomes a `*.so` with `no-prefer-dynamic`
Since it does not make sense to do so. If someone prefers no dynamic stuff, the last thing they want to look for is an .so file. Also add a regression test. Without the fix, the test fails with:
error: test compilation failed although it shouldn't!
--- stderr -------------------------------
error: extern location for no_prefer_dynamic_lib does not exist: .../auxiliary/libno_prefer_dynamic_lib.so
--> .../no-prefer-dynamic-means-no-so.rs:9:5
|
LL | no_prefer_dynamic_lib::return_42();
| ^^^^^^^^^^^^^^^^^^^^^
### Needed by:
- rust-lang/rust#150591 because of rust-lang/rust#151271. But IMHO this PR makes sense on its own.
### Must wait for:
- [x] rust-lang/rust#151695
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Feb 5, 2026
…, r=ChrisDenton
library/std: Rename `ON_BROKEN_PIPE_FLAG_USED` to `ON_BROKEN_PIPE_USED`
This commit is a pure internal rename and does not change any functionality.
The `FLAG_` part of `ON_BROKEN_PIPE_FLAG_USED` comes from that the compiler flag `-Zon-broken-pipe=...` is used to enable the feature.
Remove the `FLAG_` part so the name works both for the current compiler flag `-Zon-broken-pipe=...` and for the upcoming [Externally Implementable Item `#[std::io::on_broken_pipe]`](rust-lang#150591) PR. This makes the diff of that PR smaller.
The local variable name `sigpipe_attr_specified` comes from way back when the feature was controlled with an `fn main()` attribute called `#[unix_sigpipe = "..."]`. Rename that too.
rust-timer added a commit that referenced this pull request Feb 5, 2026
Rollup merge of #152133 - Enselic:on-broken-pipe-flag-rename, r=ChrisDenton
library/std: Rename `ON_BROKEN_PIPE_FLAG_USED` to `ON_BROKEN_PIPE_USED`
This commit is a pure internal rename and does not change any functionality.
The `FLAG_` part of `ON_BROKEN_PIPE_FLAG_USED` comes from that the compiler flag `-Zon-broken-pipe=...` is used to enable the feature.
Remove the `FLAG_` part so the name works both for the current compiler flag `-Zon-broken-pipe=...` and for the upcoming [Externally Implementable Item `#[std::io::on_broken_pipe]`](#150591) PR. This makes the diff of that PR smaller.
The local variable name `sigpipe_attr_specified` comes from way back when the feature was controlled with an `fn main()` attribute called `#[unix_sigpipe = "..."]`. Rename that too.
@rust-bors

This comment has been minimized.

@rust-bors

This comment has been minimized.

@EnselicEnselic mentioned this pull request Mar 2, 2026
23 tasks
@Enselic
Enselicforce-pushed the add-on_broken_pipe branch from 4bca7a1 to 6ec5d30CompareMay 18, 2026 07:14
@rust-bors

rust-borsBot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

☔ The latest upstream changes (presumably #157913) made this pull request unmergeable. Please resolve the merge conflicts.

ghaaj pushed a commit to ghaaj/polygrammar that referenced this pull request Aug 7, 2026
…=jdonszelmann
compiletest: Don't assume `aux-crate` becomes a `*.so` with `no-prefer-dynamic`
Since it does not make sense to do so. If someone prefers no dynamic stuff, the last thing they want to look for is an .so file. Also add a regression test. Without the fix, the test fails with:
error: test compilation failed although it shouldn't!
--- stderr -------------------------------
error: extern location for no_prefer_dynamic_lib does not exist: .../auxiliary/libno_prefer_dynamic_lib.so
--> .../no-prefer-dynamic-means-no-so.rs:9:5
|
LL | no_prefer_dynamic_lib::return_42();
| ^^^^^^^^^^^^^^^^^^^^^
### Needed by:
- rust-lang/rust#150591 because of rust-lang/rust#151271. But IMHO this PR makes sense on its own.
### Must wait for:
- [x] rust-lang/rust#151695
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-compiletestArea: The compiletest test runnerA-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-run-makeArea: port run-make Makefiles to rmake.rsA-testsuiteArea: The testsuite used to check the correctness of rustcA-tidyArea: The tidy toolO-hermitOperating System: HermitO-SGXTarget: SGXO-solidOperating System: SOLIDO-unixOperating system: Unix-likeO-windowsOperating system: WindowsS-waiting-on-authorStatus: This is awaiting some action (such as code changes or more information) from the author.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)T-clippyRelevant to the Clippy team.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-libsRelevant 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.

4 participants

@Enselic@rust-log-analyzer@RalfJung@rustbot