From 5e624bf4bad3156f63ca95702b7bd6246751ded5 Mon Sep 17 00:00:00 2001 From: Martin Nordholts Date: Mon, 24 Oct 2022 20:14:28 +0200 Subject: [PATCH] rustdoc: Use `unix_sigpipe` instead of `rustc_driver::set_sigpipe_handler` Start using `unix_sigpipe` instead of `rustc_driver::set_sigpipe_handler`. After this has been merged, we can completely remove `rustc_driver::set_sigpipe_handler`. Verification of this change --------------------------- 1. Remove `#[unix_sigpipe = "sig_dfl"]` 1. Run `./x.py build` 1. Run `./build/aarch64-apple-darwin/stage1/bin/rustdoc --help | false` 1. Observe ICE 1. Add back `#[unix_sigpipe = "sig_dfl"]` 1. Run `./x.py build` 1. Run `./build/aarch64-apple-darwin/stage1/bin/rustdoc --help | false` 1. Observe ICE fixed --- src/librustdoc/lib.rs | 1 - src/tools/rustdoc/main.rs | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index 793061a9f7a06..4cf9435d9c8ee 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -154,7 +154,6 @@ pub fn main() { } } - rustc_driver::set_sigpipe_handler(); rustc_driver::install_ice_hook(); // When using CI artifacts (with `download_stage1 = true`), tracing is unconditionally built diff --git a/src/tools/rustdoc/main.rs b/src/tools/rustdoc/main.rs index 5b499a1fa1fa8..b81f46d1211ce 100644 --- a/src/tools/rustdoc/main.rs +++ b/src/tools/rustdoc/main.rs @@ -1,3 +1,6 @@ +#![feature(unix_sigpipe)] + +#[unix_sigpipe = "sig_dfl"] fn main() { rustdoc::main() }