Skip to content

Conversation

@Enselic
Copy link
Member

@Enselic Enselic commented Jan 2, 2026

@rustbot rustbot 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
@Enselic Enselic changed the title Add on broken pipe Add initial #![feature(on_broken_pipe)] code Jan 2, 2026
@rust-log-analyzer

This comment has been minimized.

@Enselic Enselic force-pushed the add-on_broken_pipe branch from 7ce0046 to 5825fb6 Compare January 2, 2026 15:05
So that the name is semantically correct for
`#[feature(on_broken_pipe)]` (and actually also `-Zon-broken-pipe` if we
end up keeping that).
…position

So we don't need to update the test when the implementation changes. The
default will work fine. No need to set it explicitly to Error. That is
the default.
@Enselic Enselic force-pushed the add-on_broken_pipe branch from 5825fb6 to 7b52018 Compare January 5, 2026 21:46
@rustbot rustbot 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
@Enselic Enselic changed the title Add initial #![feature(on_broken_pipe)] code Replace -Zon-broken-pipe=... with Externally Implementable Item #[std::io::on_broken_pipe() -> std::io::OnBrokenPipe Jan 5, 2026
@Enselic Enselic changed the title Replace -Zon-broken-pipe=... with Externally Implementable Item #[std::io::on_broken_pipe() -> std::io::OnBrokenPipe Replace -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.

quick AI hack that I have not reviewed yet
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

Comment on lines +314 to +320
// `std::io::on_broken_pipe` is implemented via EII and becomes an `extern "Rust"`
// function without a body. Under v0 mangling this shows up with a mangled symbol name
// (e.g. `_RNv..._3std2io14on_broken_pipe`).
//
// Miri does not support the real behavior (changing host SIGPIPE disposition), so we
// treat this as a no-op and request inheriting SIGPIPE.
name if name == "on_broken_pipe" || name.contains("std2io14on_broken_pipe") => {
Copy link
Member

@RalfJung RalfJung Jan 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this is just for testing for now, but this hack is definitely not something we'd want to land.

The proper fix here is to implement EII in Miri, so that the real implementation gets invoked. We already have hacks in place to ignore std trying to change the host SIGPIPE disposition.

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-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 S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants