1
Fork 0

Support #[unix_sigpipe = "inherit|sig_dfl|sig_ign"] on fn main()

This makes it possible to instruct libstd to never touch the signal
handler for `SIGPIPE`, which makes programs pipeable by default (e.g.
with `./your-program | head -n 1`) without `ErrorKind::BrokenPipe`
errors.
This commit is contained in:
Martin Nordholts 2022-07-05 19:56:22 +02:00
parent ee285eab69
commit ddee45e1d7
46 changed files with 449 additions and 43 deletions

View file

@ -2117,6 +2117,7 @@ fn check_invalid_crate_level_attr(tcx: TyCtxt<'_>, attrs: &[Attribute]) {
sym::automatically_derived,
sym::start,
sym::rustc_main,
sym::unix_sigpipe,
sym::derive,
sym::test,
sym::test_case,