-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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: #97889
- Loading branch information
Showing
4 changed files
with
13 additions
and
1 deletion.
There are no files selected for viewing
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...tes/unix_sigpipe/unix_sigpipe-list.stderr → ...ix_sigpipe/unix_sigpipe-ident-list.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#![feature(unix_sigpipe)] | ||
|
||
#[unix_sigpipe("sig_dfl")] //~ error: malformed `unix_sigpipe` attribute input | ||
fn main() {} |
8 changes: 8 additions & 0 deletions
8
tests/ui/attributes/unix_sigpipe/unix_sigpipe-str-list.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|