Skip to content

Commit 3d25d44

Browse files
Rollup merge of rust-lang#121527 - Enselic:unix_sigpipe-tests-fixes, r=davidtwco
unix_sigpipe: Simple fixes and improvements in tests In rust-lang#120832 I included 5 preparatory commits. It will take a while before discussions there and in rust-lang#62569 is settled, so here is a PR that splits out 4 of the commits that are easy to review, to get them out of the way. r? `@davidtwco` who already approved these commits in rust-lang#120832 (but I have tweaked them a bit and rebased them since then). For the convenience of my reviewer, here are the full commit messages of the commits: <details> <summary>Click to expand</summary> ``` commit 948b1d6 (HEAD -> unix_sigpipe-tests-fixes, origin/unix_sigpipe-tests-fixes) Author: Martin Nordholts <[email protected]> Date: Fri Feb 9 07:57:27 2024 +0100 tests: Add unix_sigpipe-different-duplicates.rs test variant To make sure that #[unix_sigpipe = "x"] #[unix_sigpipe = "y"] behaves like #[unix_sigpipe = "x"] #[unix_sigpipe = "x"] commit d14f158 Author: Martin Nordholts <[email protected]> Date: Fri Feb 9 08:47:47 2024 +0100 tests: Combine unix_sigpipe-not-used.rs and unix_sigpipe-only-feature.rs The only difference between the files is the presence/absence of #![feature(unix_sigpipe)] attribute. Avoid duplication by using revisions instead. commit a1cb3db Author: Martin Nordholts <[email protected]> Date: Fri Feb 9 06:44:56 2024 +0100 tests: Rename unix_sigpipe.rs to unix_sigpipe-bare.rs for clarity The test is for the "bare" variant of the attribute that looks like this: #[unix_sigpipe] which is not allowed, because it must look like this: #[unix_sigpipe = "sig_ign"] commit e060274 Author: Martin Nordholts <[email protected]> Date: Fri Feb 9 05:48:24 2024 +0100 tests: Fix typo unix_sigpipe-error.rs -> unix_sigpipe-sig_ign.rs There is no error expected. It's simply the "regular" test for sig_ign. So rename it. ``` </details> Tracking issue: rust-lang#97889
2 parents 1638501 + 948b1d6 commit 3d25d44

9 files changed

+25
-16
lines changed

tests/ui/attributes/unix_sigpipe/unix_sigpipe.stderr tests/ui/attributes/unix_sigpipe/unix_sigpipe-bare.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: valid values for `#[unix_sigpipe = "..."]` are `inherit`, `sig_ign`, or `sig_dfl`
2-
--> $DIR/unix_sigpipe.rs:3:1
2+
--> $DIR/unix_sigpipe-bare.rs:3:1
33
|
44
LL | #[unix_sigpipe]
55
| ^^^^^^^^^^^^^^^
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#![feature(unix_sigpipe)]
2+
3+
#[unix_sigpipe = "sig_ign"]
4+
#[unix_sigpipe = "inherit"] //~ error: multiple `unix_sigpipe` attributes
5+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
error: multiple `unix_sigpipe` attributes
2+
--> $DIR/unix_sigpipe-different-duplicates.rs:4:1
3+
|
4+
LL | #[unix_sigpipe = "inherit"]
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
6+
|
7+
note: attribute also specified here
8+
--> $DIR/unix_sigpipe-different-duplicates.rs:3:1
9+
|
10+
LL | #[unix_sigpipe = "sig_ign"]
11+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
12+
13+
error: aborting due to 1 previous error
14+
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![feature(unix_sigpipe)]
22

3-
#[unix_sigpipe = "sig_ign"]
3+
#[unix_sigpipe = "inherit"]
44
#[unix_sigpipe = "inherit"] //~ error: multiple `unix_sigpipe` attributes
55
fn main() {}

tests/ui/attributes/unix_sigpipe/unix_sigpipe-duplicates.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ LL | #[unix_sigpipe = "inherit"]
77
note: attribute also specified here
88
--> $DIR/unix_sigpipe-duplicates.rs:3:1
99
|
10-
LL | #[unix_sigpipe = "sig_ign"]
10+
LL | #[unix_sigpipe = "inherit"]
1111
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
1212

1313
error: aborting due to 1 previous error

tests/ui/attributes/unix_sigpipe/unix_sigpipe-not-used.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
//@ revisions: with_feature without_feature
12
//@ run-pass
23
//@ aux-build:sigpipe-utils.rs
34

5+
#![cfg_attr(with_feature, feature(unix_sigpipe))]
6+
47
fn main() {
58
extern crate sigpipe_utils;
69

tests/ui/attributes/unix_sigpipe/unix_sigpipe-only-feature.rs

-13
This file was deleted.

0 commit comments

Comments
 (0)