Rollup merge of #121527 - Enselic:unix_sigpipe-tests-fixes, r=davidtwco
unix_sigpipe: Simple fixes and improvements in tests In https://github.com/rust-lang/rust/pull/120832 I included 5 preparatory commits. It will take a while before discussions there and in https://github.com/rust-lang/rust/issues/62569 is settled, so here is a PR that splits out 4 of the commits that are easy to review, to get them out of the way. r? ``@davidtwco`` who already approved these commits in https://github.com/rust-lang/rust/pull/120832 (but I have tweaked them a bit and rebased them since then). For the convenience of my reviewer, here are the full commit messages of the commits: <details> <summary>Click to expand</summary> ``` commit948b1d68ab
(HEAD -> unix_sigpipe-tests-fixes, origin/unix_sigpipe-tests-fixes) Author: Martin Nordholts <martin.nordholts@codetale.se> Date: Fri Feb 9 07:57:27 2024 +0100 tests: Add unix_sigpipe-different-duplicates.rs test variant To make sure that #[unix_sigpipe = "x"] #[unix_sigpipe = "y"] behaves like #[unix_sigpipe = "x"] #[unix_sigpipe = "x"] commitd14f15862d
Author: Martin Nordholts <martin.nordholts@codetale.se> Date: Fri Feb 9 08:47:47 2024 +0100 tests: Combine unix_sigpipe-not-used.rs and unix_sigpipe-only-feature.rs The only difference between the files is the presence/absence of #![feature(unix_sigpipe)] attribute. Avoid duplication by using revisions instead. commita1cb3dba84
Author: Martin Nordholts <martin.nordholts@codetale.se> Date: Fri Feb 9 06:44:56 2024 +0100 tests: Rename unix_sigpipe.rs to unix_sigpipe-bare.rs for clarity The test is for the "bare" variant of the attribute that looks like this: #[unix_sigpipe] which is not allowed, because it must look like this: #[unix_sigpipe = "sig_ign"] commite060274e55
Author: Martin Nordholts <martin.nordholts@codetale.se> Date: Fri Feb 9 05:48:24 2024 +0100 tests: Fix typo unix_sigpipe-error.rs -> unix_sigpipe-sig_ign.rs There is no error expected. It's simply the "regular" test for sig_ign. So rename it. ``` </details> Tracking issue: https://github.com/rust-lang/rust/issues/97889
This commit is contained in:
commit
d8e6550838
9 changed files with 25 additions and 16 deletions
|
@ -1,5 +1,5 @@
|
||||||
error: valid values for `#[unix_sigpipe = "..."]` are `inherit`, `sig_ign`, or `sig_dfl`
|
error: valid values for `#[unix_sigpipe = "..."]` are `inherit`, `sig_ign`, or `sig_dfl`
|
||||||
--> $DIR/unix_sigpipe.rs:3:1
|
--> $DIR/unix_sigpipe-bare.rs:3:1
|
||||||
|
|
|
|
||||||
LL | #[unix_sigpipe]
|
LL | #[unix_sigpipe]
|
||||||
| ^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^
|
|
@ -0,0 +1,5 @@
|
||||||
|
#![feature(unix_sigpipe)]
|
||||||
|
|
||||||
|
#[unix_sigpipe = "sig_ign"]
|
||||||
|
#[unix_sigpipe = "inherit"] //~ error: multiple `unix_sigpipe` attributes
|
||||||
|
fn main() {}
|
|
@ -0,0 +1,14 @@
|
||||||
|
error: multiple `unix_sigpipe` attributes
|
||||||
|
--> $DIR/unix_sigpipe-different-duplicates.rs:4:1
|
||||||
|
|
|
||||||
|
LL | #[unix_sigpipe = "inherit"]
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
|
||||||
|
|
|
||||||
|
note: attribute also specified here
|
||||||
|
--> $DIR/unix_sigpipe-different-duplicates.rs:3:1
|
||||||
|
|
|
||||||
|
LL | #[unix_sigpipe = "sig_ign"]
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: aborting due to 1 previous error
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#![feature(unix_sigpipe)]
|
#![feature(unix_sigpipe)]
|
||||||
|
|
||||||
#[unix_sigpipe = "sig_ign"]
|
#[unix_sigpipe = "inherit"]
|
||||||
#[unix_sigpipe = "inherit"] //~ error: multiple `unix_sigpipe` attributes
|
#[unix_sigpipe = "inherit"] //~ error: multiple `unix_sigpipe` attributes
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
|
|
@ -7,7 +7,7 @@ LL | #[unix_sigpipe = "inherit"]
|
||||||
note: attribute also specified here
|
note: attribute also specified here
|
||||||
--> $DIR/unix_sigpipe-duplicates.rs:3:1
|
--> $DIR/unix_sigpipe-duplicates.rs:3:1
|
||||||
|
|
|
|
||||||
LL | #[unix_sigpipe = "sig_ign"]
|
LL | #[unix_sigpipe = "inherit"]
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
error: aborting due to 1 previous error
|
error: aborting due to 1 previous error
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
|
//@ revisions: with_feature without_feature
|
||||||
//@ run-pass
|
//@ run-pass
|
||||||
//@ aux-build:sigpipe-utils.rs
|
//@ aux-build:sigpipe-utils.rs
|
||||||
|
|
||||||
|
#![cfg_attr(with_feature, feature(unix_sigpipe))]
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
extern crate sigpipe_utils;
|
extern crate sigpipe_utils;
|
||||||
|
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
//@ run-pass
|
|
||||||
//@ aux-build:sigpipe-utils.rs
|
|
||||||
|
|
||||||
#![feature(unix_sigpipe)]
|
|
||||||
|
|
||||||
fn main() {
|
|
||||||
extern crate sigpipe_utils;
|
|
||||||
|
|
||||||
// Only #![feature(unix_sigpipe)] is enabled, not #[unix_sigpipe = "..."].
|
|
||||||
// This shall not change any behavior, so we still expect SIGPIPE to be
|
|
||||||
// ignored
|
|
||||||
sigpipe_utils::assert_sigpipe_handler(sigpipe_utils::SignalHandler::Ignore);
|
|
||||||
}
|
|
Loading…
Add table
Reference in a new issue