forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
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 rust-lang#108651 - LeSeulArtichaut:108645-target-feat…
…ure-on-main, r=Nilstrieb Forbid the use of `#[target_feature]` on `main` Fixes rust-lang#108645.
- Loading branch information
Showing
9 changed files
with
84 additions
and
1 deletion.
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
7 changes: 7 additions & 0 deletions
7
tests/ui/rfcs/rfc-2396-target_feature-11/issue-108645-target-feature-on-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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// only-x86_64 | ||
|
||
#![feature(target_feature_11)] | ||
|
||
#[target_feature(enable = "avx2")] | ||
fn main() {} | ||
//~^ ERROR `main` function is not allowed to have `#[target_feature]` |
8 changes: 8 additions & 0 deletions
8
tests/ui/rfcs/rfc-2396-target_feature-11/issue-108645-target-feature-on-main.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: `main` function is not allowed to have `#[target_feature]` | ||
--> $DIR/issue-108645-target-feature-on-main.rs:6:1 | ||
| | ||
LL | fn main() {} | ||
| ^^^^^^^^^ `main` function is not allowed to have `#[target_feature]` | ||
|
||
error: aborting due to previous error | ||
|
9 changes: 9 additions & 0 deletions
9
tests/ui/rfcs/rfc-2396-target_feature-11/issue-108645-target-feature-on-start.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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// only-x86_64 | ||
|
||
#![feature(start)] | ||
#![feature(target_feature_11)] | ||
|
||
#[start] | ||
#[target_feature(enable = "avx2")] | ||
//~^ ERROR `start` is not allowed to have `#[target_feature]` | ||
fn start(_argc: isize, _argv: *const *const u8) -> isize { 0 } |
11 changes: 11 additions & 0 deletions
11
tests/ui/rfcs/rfc-2396-target_feature-11/issue-108645-target-feature-on-start.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,11 @@ | ||
error: `start` is not allowed to have `#[target_feature]` | ||
--> $DIR/issue-108645-target-feature-on-start.rs:7:1 | ||
| | ||
LL | #[target_feature(enable = "avx2")] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
LL | | ||
LL | fn start(_argc: isize, _argv: *const *const u8) -> isize { 0 } | ||
| -------------------------------------------------------- `start` is not allowed to have `#[target_feature]` | ||
|
||
error: aborting due to previous error | ||
|