-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stabilize
#[unix_sigpipe = "sig_dfl"]
on fn main()
The attribute is used like this: #[unix_sigpipe = "sig_dfl"] fn main() { // ... } When used, `SIGPIPE` will be set to `SIG_DFL` before `fn main()` is invoked, rather than being set to `SIG_IGN` which is the default. This commit does NOT stabilize `#[unix_sigpipe = "sig_ign"]` or `#[unix_sigpipe = "inherit"]`. See the PR for more info.
- Loading branch information
Showing
49 changed files
with
265 additions
and
65 deletions.
There are no files selected for viewing
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
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
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 |
---|---|---|
@@ -1,4 +1,6 @@ | ||
#![feature(unix_sigpipe)] | ||
// revisions: with_feature without_feature | ||
|
||
#[unix_sigpipe] //~ error: valid values for `#[unix_sigpipe = "..."]` are `inherit`, `sig_ign`, or `sig_dfl` | ||
#![cfg_attr(with_feature, feature(unix_sigpipe))] | ||
|
||
#[unix_sigpipe] //~ error: the only valid variant of the `unix_sigpipe` attribute is `#[unix_sigpipe = "sig_dfl"] | ||
fn main() {} |
This file was deleted.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
tests/ui/attributes/unix_sigpipe/unix_sigpipe-bare.with_feature.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: the only valid variant of the `unix_sigpipe` attribute is `#[unix_sigpipe = "sig_dfl"]` | ||
--> $DIR/unix_sigpipe-bare.rs:5:1 | ||
| | ||
LL | #[unix_sigpipe] | ||
| ^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 1 previous error | ||
|
8 changes: 8 additions & 0 deletions
8
tests/ui/attributes/unix_sigpipe/unix_sigpipe-bare.without_feature.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: the only valid variant of the `unix_sigpipe` attribute is `#[unix_sigpipe = "sig_dfl"]` | ||
--> $DIR/unix_sigpipe-bare.rs:5:1 | ||
| | ||
LL | #[unix_sigpipe] | ||
| ^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 1 previous error | ||
|
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 |
---|---|---|
@@ -1,4 +1,6 @@ | ||
#![feature(unix_sigpipe)] | ||
// revisions: with_feature without_feature | ||
|
||
#![cfg_attr(with_feature, feature(unix_sigpipe))] | ||
#![unix_sigpipe = "sig_dfl"] //~ error: `unix_sigpipe` attribute cannot be used at crate level | ||
|
||
fn main() {} |
2 changes: 1 addition & 1 deletion
2
...es/unix_sigpipe/unix_sigpipe-crate.stderr → ...pe/unix_sigpipe-crate.with_feature.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
17 changes: 17 additions & 0 deletions
17
tests/ui/attributes/unix_sigpipe/unix_sigpipe-crate.without_feature.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,17 @@ | ||
error: `unix_sigpipe` attribute cannot be used at crate level | ||
--> $DIR/unix_sigpipe-crate.rs:4:1 | ||
| | ||
LL | #![unix_sigpipe = "sig_dfl"] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
LL | | ||
LL | fn main() {} | ||
| ---- the inner attribute doesn't annotate this function | ||
| | ||
help: perhaps you meant to use an outer attribute | ||
| | ||
LL - #![unix_sigpipe = "sig_dfl"] | ||
LL + #[unix_sigpipe = "sig_dfl"] | ||
| | ||
|
||
error: aborting due to 1 previous error | ||
|
7 changes: 5 additions & 2 deletions
7
tests/ui/attributes/unix_sigpipe/unix_sigpipe-different-duplicates.rs
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 |
---|---|---|
@@ -1,5 +1,8 @@ | ||
#![feature(unix_sigpipe)] | ||
// revisions: with_feature without_feature | ||
|
||
#![cfg_attr(with_feature, feature(unix_sigpipe))] | ||
|
||
#[unix_sigpipe = "sig_dfl"] | ||
#[unix_sigpipe = "sig_ign"] //~ error: multiple `unix_sigpipe` attributes | ||
#[unix_sigpipe = "sig_ign"] //[without_feature]~ the `#[unix_sigpipe = "sig_ign"]` attribute is an experimental feature | ||
//~^ error: multiple `unix_sigpipe` attributes | ||
fn main() {} |
4 changes: 2 additions & 2 deletions
4
.../unix_sigpipe-different-duplicates.stderr → ...-different-duplicates.with_feature.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
25 changes: 25 additions & 0 deletions
25
tests/ui/attributes/unix_sigpipe/unix_sigpipe-different-duplicates.without_feature.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,25 @@ | ||
error[E0658]: the `#[unix_sigpipe = "sig_ign"]` attribute is an experimental feature | ||
--> $DIR/unix_sigpipe-different-duplicates.rs:6:1 | ||
| | ||
LL | #[unix_sigpipe = "sig_ign"] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #97889 <https://github.com/rust-lang/rust/issues/97889> for more information | ||
= help: add `#![feature(unix_sigpipe)]` to the crate attributes to enable | ||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date | ||
|
||
error: multiple `unix_sigpipe` attributes | ||
--> $DIR/unix_sigpipe-different-duplicates.rs:6:1 | ||
| | ||
LL | #[unix_sigpipe = "sig_ign"] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute | ||
| | ||
note: attribute also specified here | ||
--> $DIR/unix_sigpipe-different-duplicates.rs:5:1 | ||
| | ||
LL | #[unix_sigpipe = "sig_dfl"] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0658`. |
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
4 changes: 2 additions & 2 deletions
4
...ix_sigpipe/unix_sigpipe-duplicates.stderr → ...ix_sigpipe-duplicates.with_feature.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
14 changes: 14 additions & 0 deletions
14
tests/ui/attributes/unix_sigpipe/unix_sigpipe-duplicates.without_feature.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,14 @@ | ||
error: multiple `unix_sigpipe` attributes | ||
--> $DIR/unix_sigpipe-duplicates.rs:6:1 | ||
| | ||
LL | #[unix_sigpipe = "sig_dfl"] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute | ||
| | ||
note: attribute also specified here | ||
--> $DIR/unix_sigpipe-duplicates.rs:5:1 | ||
| | ||
LL | #[unix_sigpipe = "sig_dfl"] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 1 previous error | ||
|
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
4 changes: 2 additions & 2 deletions
4
...re-gates/feature-gate-unix_sigpipe.stderr → ...ix_sigpipe-inherit.without_feature.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 |
---|---|---|
@@ -1,4 +1,6 @@ | ||
#![feature(unix_sigpipe)] | ||
// revisions: with_feature without_feature | ||
|
||
#![cfg_attr(with_feature, feature(unix_sigpipe))] | ||
|
||
#[unix_sigpipe(sig_dfl)] //~ error: malformed `unix_sigpipe` attribute input | ||
fn main() {} |
2 changes: 1 addition & 1 deletion
2
...tes/unix_sigpipe/unix_sigpipe-list.stderr → ...ipe/unix_sigpipe-list.with_feature.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
15 changes: 15 additions & 0 deletions
15
tests/ui/attributes/unix_sigpipe/unix_sigpipe-list.without_feature.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,15 @@ | ||
error: malformed `unix_sigpipe` attribute input | ||
--> $DIR/unix_sigpipe-list.rs:5:1 | ||
| | ||
LL | #[unix_sigpipe(sig_dfl)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
help: the following are the possible correct uses | ||
| | ||
LL | #[unix_sigpipe = "inherit|sig_ign|sig_dfl"] | ||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
LL | #[unix_sigpipe] | ||
| ~~~~~~~~~~~~~~~ | ||
|
||
error: aborting due to 1 previous error | ||
|
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
2 changes: 1 addition & 1 deletion
2
...x_sigpipe/unix_sigpipe-non-main-fn.stderr → ...x_sigpipe-non-main-fn.with_feature.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
8 changes: 8 additions & 0 deletions
8
tests/ui/attributes/unix_sigpipe/unix_sigpipe-non-main-fn.without_feature.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: `unix_sigpipe` attribute can only be used on `fn main()` | ||
--> $DIR/unix_sigpipe-non-main-fn.rs:5:1 | ||
| | ||
LL | #[unix_sigpipe = "sig_dfl"] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 1 previous error | ||
|
4 changes: 3 additions & 1 deletion
4
tests/ui/attributes/unix_sigpipe/unix_sigpipe-non-root-main.rs
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
2 changes: 1 addition & 1 deletion
2
...sigpipe/unix_sigpipe-non-root-main.stderr → ...sigpipe-non-root-main.with_feature.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
8 changes: 8 additions & 0 deletions
8
tests/ui/attributes/unix_sigpipe/unix_sigpipe-non-root-main.without_feature.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: `unix_sigpipe` attribute can only be used on root `fn main()` | ||
--> $DIR/unix_sigpipe-non-root-main.rs:6:5 | ||
| | ||
LL | #[unix_sigpipe = "sig_dfl"] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 1 previous error | ||
|
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
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
13 changes: 13 additions & 0 deletions
13
tests/ui/attributes/unix_sigpipe/unix_sigpipe-sig_ign.without_feature.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,13 @@ | ||
error[E0658]: the `#[unix_sigpipe = "sig_ign"]` attribute is an experimental feature | ||
--> $DIR/unix_sigpipe-sig_ign.rs:8:1 | ||
| | ||
LL | #[unix_sigpipe = "sig_ign"] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #97889 <https://github.com/rust-lang/rust/issues/97889> for more information | ||
= help: add `#![feature(unix_sigpipe)]` to the crate attributes to enable | ||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0658`. |
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
2 changes: 1 addition & 1 deletion
2
...es/unix_sigpipe/unix_sigpipe-start.stderr → ...pe/unix_sigpipe-start.with_feature.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
2 changes: 1 addition & 1 deletion
2
...s/unix_sigpipe/unix_sigpipe-struct.stderr → ...unix_sigpipe-start.without_feature.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
8 changes: 8 additions & 0 deletions
8
tests/ui/attributes/unix_sigpipe/unix_sigpipe-struct.with_feature.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: `unix_sigpipe` attribute can only be used on `fn main()` | ||
--> $DIR/unix_sigpipe-struct.rs:5:1 | ||
| | ||
LL | #[unix_sigpipe = "sig_dfl"] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 1 previous error | ||
|
Oops, something went wrong.