about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorMartin Nordholts <martin.nordholts@codetale.se>2024-03-10 14:34:01 +0100
committerMartin Nordholts <martin.nordholts@codetale.se>2024-03-12 06:04:41 +0100
commit98553ce27e68e2d7b8fb3919c9aec7253dfd3a5a (patch)
tree7fea0ec1116683ae6391e8ad789b987fab50b44b /tests
parent5aad51d015b8d3f6d823a6bf9dbc8ae3b9fd10c5 (diff)
downloadrust-98553ce27e68e2d7b8fb3919c9aec7253dfd3a5a.tar.gz
rust-98553ce27e68e2d7b8fb3919c9aec7253dfd3a5a.zip
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
Diffstat (limited to 'tests')
-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
+