about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJubilee <46493976+workingjubilee@users.noreply.github.com>2024-03-12 09:04:02 -0700
committerGitHub <noreply@github.com>2024-03-12 09:04:02 -0700
commit778c76c6a700f96303684b647ee2e692f0c36319 (patch)
tree0c13a483ad6532484eef855d34b9348ae879d2ce
parent1aef2fb259efe10fc0c05fc875026cb3e9e42283 (diff)
parent98553ce27e68e2d7b8fb3919c9aec7253dfd3a5a (diff)
downloadrust-778c76c6a700f96303684b647ee2e692f0c36319.tar.gz
rust-778c76c6a700f96303684b647ee2e692f0c36319.zip
Rollup merge of #122363 - Enselic:unix_sigpipe-str-list, r=oli-obk
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. Having a test for this case gives peace of mind.

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

Tracking issue: https://github.com/rust-lang/rust/issues/97889
-rw-r--r--tests/ui/attributes/unix_sigpipe/unix_sigpipe-ident-list.rs (renamed from tests/ui/attributes/unix_sigpipe/unix_sigpipe-list.rs)0
-rw-r--r--tests/ui/attributes/unix_sigpipe/unix_sigpipe-ident-list.stderr (renamed from tests/ui/attributes/unix_sigpipe/unix_sigpipe-list.stderr)2
-rw-r--r--tests/ui/attributes/unix_sigpipe/unix_sigpipe-str-list.rs4
-rw-r--r--tests/ui/attributes/unix_sigpipe/unix_sigpipe-str-list.stderr8
4 files changed, 13 insertions, 1 deletions
diff --git a/tests/ui/attributes/unix_sigpipe/unix_sigpipe-list.rs b/tests/ui/attributes/unix_sigpipe/unix_sigpipe-ident-list.rs
index 462ae24a884..462ae24a884 100644
--- a/tests/ui/attributes/unix_sigpipe/unix_sigpipe-list.rs
+++ b/tests/ui/attributes/unix_sigpipe/unix_sigpipe-ident-list.rs
diff --git a/tests/ui/attributes/unix_sigpipe/unix_sigpipe-list.stderr b/tests/ui/attributes/unix_sigpipe/unix_sigpipe-ident-list.stderr
index 66902f3ca9a..a020f21e6ca 100644
--- a/tests/ui/attributes/unix_sigpipe/unix_sigpipe-list.stderr
+++ b/tests/ui/attributes/unix_sigpipe/unix_sigpipe-ident-list.stderr
@@ -1,5 +1,5 @@
 error: malformed `unix_sigpipe` attribute input
-  --> $DIR/unix_sigpipe-list.rs:3:1
+  --> $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"]`
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
+