Skip to content

Commit 8a5ce1d

Browse files
authored
Rollup merge of #102587 - Enselic:rustc-unix_sigpipe, r=jackh726
rustc: Use `unix_sigpipe` instead of `rustc_driver::set_sigpipe_handler` This is the first (known) step towards starting to use `unix_sigpipe` in the wild. Eventually, `rustc_driver::set_sigpipe_handler` can be removed and all clients can use `unix_sigpipe` instead. For now we just start using `unix_sigpipe` in one place: `rustc` itself. It is easy to manually verify this change. If you remove `#[unix_sigpipe = "sig_dfl"]` and run `./x.py build` you will get an ICE when you do `./build/x86_64-unknown-linux-gnu/stage1/bin/rustc --help | false`. Add back `#[unix_sigpipe = "sig_dfl"]` and the ICE disappears again. PR that added `set_sigpipe_handler`: #49606 Tracking issue for `unix_sigpipe`: #97889 Not sure exactly how to label this PR. Going with T-libs for now since this is a T-libs feature. ````@rustdoc```` labels +T-libs
2 parents d2d44f6 + 093b075 commit 8a5ce1d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

compiler/rustc/src/main.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![feature(unix_sigpipe)]
2+
13
// A note about jemalloc: rustc uses jemalloc when built for CI and
24
// distribution. The obvious way to do this is with the `#[global_allocator]`
35
// mechanism. However, for complicated reasons (see
@@ -23,6 +25,7 @@
2325
// libraries. So we must reference jemalloc symbols one way or another, because
2426
// this file is the only object code in the rustc executable.
2527

28+
#[unix_sigpipe = "sig_dfl"]
2629
fn main() {
2730
// See the comment at the top of this file for an explanation of this.
2831
#[cfg(feature = "jemalloc-sys")]
@@ -58,6 +61,5 @@ fn main() {
5861
}
5962
}
6063

61-
rustc_driver::set_sigpipe_handler();
6264
rustc_driver::main()
6365
}

0 commit comments

Comments
 (0)