diff --git a/tests/ui/attributes/unix_sigpipe/unix_sigpipe.rs b/tests/ui/attributes/unix_sigpipe/unix_sigpipe-bare.rs similarity index 100% rename from tests/ui/attributes/unix_sigpipe/unix_sigpipe.rs rename to tests/ui/attributes/unix_sigpipe/unix_sigpipe-bare.rs diff --git a/tests/ui/attributes/unix_sigpipe/unix_sigpipe.stderr b/tests/ui/attributes/unix_sigpipe/unix_sigpipe-bare.stderr similarity index 83% rename from tests/ui/attributes/unix_sigpipe/unix_sigpipe.stderr rename to tests/ui/attributes/unix_sigpipe/unix_sigpipe-bare.stderr index b18ec9abc3745..56218ed499ece 100644 --- a/tests/ui/attributes/unix_sigpipe/unix_sigpipe.stderr +++ b/tests/ui/attributes/unix_sigpipe/unix_sigpipe-bare.stderr @@ -1,5 +1,5 @@ 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] | ^^^^^^^^^^^^^^^ diff --git a/tests/ui/attributes/unix_sigpipe/unix_sigpipe-different-duplicates.rs b/tests/ui/attributes/unix_sigpipe/unix_sigpipe-different-duplicates.rs new file mode 100644 index 0000000000000..294cb38526bd0 --- /dev/null +++ b/tests/ui/attributes/unix_sigpipe/unix_sigpipe-different-duplicates.rs @@ -0,0 +1,5 @@ +#![feature(unix_sigpipe)] + +#[unix_sigpipe = "sig_ign"] +#[unix_sigpipe = "inherit"] //~ error: multiple `unix_sigpipe` attributes +fn main() {} diff --git a/tests/ui/attributes/unix_sigpipe/unix_sigpipe-different-duplicates.stderr b/tests/ui/attributes/unix_sigpipe/unix_sigpipe-different-duplicates.stderr new file mode 100644 index 0000000000000..c2a3b9f45f9ac --- /dev/null +++ b/tests/ui/attributes/unix_sigpipe/unix_sigpipe-different-duplicates.stderr @@ -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 + diff --git a/tests/ui/attributes/unix_sigpipe/unix_sigpipe-duplicates.rs b/tests/ui/attributes/unix_sigpipe/unix_sigpipe-duplicates.rs index 294cb38526bd0..eccb23021b6b8 100644 --- a/tests/ui/attributes/unix_sigpipe/unix_sigpipe-duplicates.rs +++ b/tests/ui/attributes/unix_sigpipe/unix_sigpipe-duplicates.rs @@ -1,5 +1,5 @@ #![feature(unix_sigpipe)] -#[unix_sigpipe = "sig_ign"] +#[unix_sigpipe = "inherit"] #[unix_sigpipe = "inherit"] //~ error: multiple `unix_sigpipe` attributes fn main() {} diff --git a/tests/ui/attributes/unix_sigpipe/unix_sigpipe-duplicates.stderr b/tests/ui/attributes/unix_sigpipe/unix_sigpipe-duplicates.stderr index 931aae96b0ff7..c86e54a1e532f 100644 --- a/tests/ui/attributes/unix_sigpipe/unix_sigpipe-duplicates.stderr +++ b/tests/ui/attributes/unix_sigpipe/unix_sigpipe-duplicates.stderr @@ -7,7 +7,7 @@ LL | #[unix_sigpipe = "inherit"] note: attribute also specified here --> $DIR/unix_sigpipe-duplicates.rs:3:1 | -LL | #[unix_sigpipe = "sig_ign"] +LL | #[unix_sigpipe = "inherit"] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 1 previous error diff --git a/tests/ui/attributes/unix_sigpipe/unix_sigpipe-not-used.rs b/tests/ui/attributes/unix_sigpipe/unix_sigpipe-not-used.rs index 778e06cb3effe..b0044f5e91999 100644 --- a/tests/ui/attributes/unix_sigpipe/unix_sigpipe-not-used.rs +++ b/tests/ui/attributes/unix_sigpipe/unix_sigpipe-not-used.rs @@ -1,6 +1,9 @@ +//@ revisions: with_feature without_feature //@ run-pass //@ aux-build:sigpipe-utils.rs +#![cfg_attr(with_feature, feature(unix_sigpipe))] + fn main() { extern crate sigpipe_utils; diff --git a/tests/ui/attributes/unix_sigpipe/unix_sigpipe-only-feature.rs b/tests/ui/attributes/unix_sigpipe/unix_sigpipe-only-feature.rs deleted file mode 100644 index 6bbe4a8d0d688..0000000000000 --- a/tests/ui/attributes/unix_sigpipe/unix_sigpipe-only-feature.rs +++ /dev/null @@ -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); -} diff --git a/tests/ui/attributes/unix_sigpipe/unix_sigpipe-error.rs b/tests/ui/attributes/unix_sigpipe/unix_sigpipe-sig_ign.rs similarity index 100% rename from tests/ui/attributes/unix_sigpipe/unix_sigpipe-error.rs rename to tests/ui/attributes/unix_sigpipe/unix_sigpipe-sig_ign.rs