-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
Replace -Zon-broken-pipe=... with Externally Implementable Item #[std::io::on_broken_pipe]
#150591
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
base: main
Are you sure you want to change the base?
Conversation
#![feature(on_broken_pipe)] code
This comment has been minimized.
This comment has been minimized.
7ce0046 to
5825fb6
Compare
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.
5825fb6 to
7b52018
Compare
#![feature(on_broken_pipe)] code-Zon-broken-pipe=... with Externally Implementable Item #[std::io::on_broken_pipe() -> std::io::OnBrokenPipe
-Zon-broken-pipe=... with Externally Implementable Item #[std::io::on_broken_pipe() -> std::io::OnBrokenPipe-Zon-broken-pipe=... with Externally Implementable Item #[std::io::on_broken_pipe]
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| // `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") => { |
There was a problem hiding this comment.
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.
The code in this PR also acts as a regression test for the fix to #150588 which I will split out in a separate PR.
TODO
missing stability attributeerrors with trivial Externally Implementable Item (eii) function inlibrary/std#150514 first in a separate PR (see compiler: Make Externally Implementable Items (eii) in std build #150592)Tracking Issues:
#[std::io::on_broken_pipe]#150588