From 98553ce27e68e2d7b8fb3919c9aec7253dfd3a5a Mon Sep 17 00:00:00 2001 From: Martin Nordholts Date: Sun, 10 Mar 2024 14:34:01 +0100 Subject: tests: Add ui/attributes/unix_sigpipe/unix_sigpipe-str-list.rs Which is a variant of [`unix_sigpipe-list.rs`][1] but where a string is used instead of an identifier. This makes it more similar to the proper form `#[unix_sigpipe = "sig_dfl"]` and thus more likely to be written by users by mistake. Also rename the first test to be more in line with the terminology of [The Reference][2]. [1]: https://github.com/rust-lang/rust/blob/master/tests/ui/attributes/unix_sigpipe/unix_sigpipe-list.rs [2]: https://doc.rust-lang.org/reference/attributes.html#meta-item-attribute-syntax --- tests/ui/attributes/unix_sigpipe/unix_sigpipe-ident-list.rs | 4 ++++ tests/ui/attributes/unix_sigpipe/unix_sigpipe-ident-list.stderr | 8 ++++++++ tests/ui/attributes/unix_sigpipe/unix_sigpipe-list.rs | 4 ---- tests/ui/attributes/unix_sigpipe/unix_sigpipe-list.stderr | 8 -------- tests/ui/attributes/unix_sigpipe/unix_sigpipe-str-list.rs | 4 ++++ tests/ui/attributes/unix_sigpipe/unix_sigpipe-str-list.stderr | 8 ++++++++ 6 files changed, 24 insertions(+), 12 deletions(-) create mode 100644 tests/ui/attributes/unix_sigpipe/unix_sigpipe-ident-list.rs create mode 100644 tests/ui/attributes/unix_sigpipe/unix_sigpipe-ident-list.stderr delete mode 100644 tests/ui/attributes/unix_sigpipe/unix_sigpipe-list.rs delete mode 100644 tests/ui/attributes/unix_sigpipe/unix_sigpipe-list.stderr create mode 100644 tests/ui/attributes/unix_sigpipe/unix_sigpipe-str-list.rs create mode 100644 tests/ui/attributes/unix_sigpipe/unix_sigpipe-str-list.stderr diff --git a/tests/ui/attributes/unix_sigpipe/unix_sigpipe-ident-list.rs b/tests/ui/attributes/unix_sigpipe/unix_sigpipe-ident-list.rs new file mode 100644 index 00000000000..462ae24a884 --- /dev/null +++ b/tests/ui/attributes/unix_sigpipe/unix_sigpipe-ident-list.rs @@ -0,0 +1,4 @@ +#![feature(unix_sigpipe)] + +#[unix_sigpipe(sig_dfl)] //~ error: malformed `unix_sigpipe` attribute input +fn main() {} diff --git a/tests/ui/attributes/unix_sigpipe/unix_sigpipe-ident-list.stderr b/tests/ui/attributes/unix_sigpipe/unix_sigpipe-ident-list.stderr new file mode 100644 index 00000000000..a020f21e6ca --- /dev/null +++ b/tests/ui/attributes/unix_sigpipe/unix_sigpipe-ident-list.stderr @@ -0,0 +1,8 @@ +error: malformed `unix_sigpipe` attribute input + --> $DIR/unix_sigpipe-ident-list.rs:3:1 + | +LL | #[unix_sigpipe(sig_dfl)] + | ^^^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[unix_sigpipe = "inherit|sig_ign|sig_dfl"]` + +error: aborting due to 1 previous error + diff --git a/tests/ui/attributes/unix_sigpipe/unix_sigpipe-list.rs b/tests/ui/attributes/unix_sigpipe/unix_sigpipe-list.rs deleted file mode 100644 index 462ae24a884..00000000000 --- a/tests/ui/attributes/unix_sigpipe/unix_sigpipe-list.rs +++ /dev/null @@ -1,4 +0,0 @@ -#![feature(unix_sigpipe)] - -#[unix_sigpipe(sig_dfl)] //~ error: malformed `unix_sigpipe` attribute input -fn main() {} diff --git a/tests/ui/attributes/unix_sigpipe/unix_sigpipe-list.stderr b/tests/ui/attributes/unix_sigpipe/unix_sigpipe-list.stderr deleted file mode 100644 index 66902f3ca9a..00000000000 --- a/tests/ui/attributes/unix_sigpipe/unix_sigpipe-list.stderr +++ /dev/null @@ -1,8 +0,0 @@ -error: malformed `unix_sigpipe` attribute input - --> $DIR/unix_sigpipe-list.rs:3:1 - | -LL | #[unix_sigpipe(sig_dfl)] - | ^^^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[unix_sigpipe = "inherit|sig_ign|sig_dfl"]` - -error: aborting due to 1 previous error - diff --git a/tests/ui/attributes/unix_sigpipe/unix_sigpipe-str-list.rs b/tests/ui/attributes/unix_sigpipe/unix_sigpipe-str-list.rs new file mode 100644 index 00000000000..22326835623 --- /dev/null +++ b/tests/ui/attributes/unix_sigpipe/unix_sigpipe-str-list.rs @@ -0,0 +1,4 @@ +#![feature(unix_sigpipe)] + +#[unix_sigpipe("sig_dfl")] //~ error: malformed `unix_sigpipe` attribute input +fn main() {} diff --git a/tests/ui/attributes/unix_sigpipe/unix_sigpipe-str-list.stderr b/tests/ui/attributes/unix_sigpipe/unix_sigpipe-str-list.stderr new file mode 100644 index 00000000000..b62c086e360 --- /dev/null +++ b/tests/ui/attributes/unix_sigpipe/unix_sigpipe-str-list.stderr @@ -0,0 +1,8 @@ +error: malformed `unix_sigpipe` attribute input + --> $DIR/unix_sigpipe-str-list.rs:3:1 + | +LL | #[unix_sigpipe("sig_dfl")] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[unix_sigpipe = "inherit|sig_ign|sig_dfl"]` + +error: aborting due to 1 previous error + -- cgit 1.4.1-3-g733a5