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#74109 - nbdd0121:issue-74082, r=petrochenkov
Only allow `repr(i128/u128)` on enum Fixes rust-lang#74082
- Loading branch information
Showing
3 changed files
with
30 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#![allow(dead_code)] | ||
|
||
#[repr(i128)] //~ ERROR: attribute should be applied to enum | ||
struct Foo; | ||
|
||
#[repr(u128)] //~ ERROR: attribute should be applied to enum | ||
struct Bar; | ||
|
||
fn main() {} |
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,19 @@ | ||
error[E0517]: attribute should be applied to enum | ||
--> $DIR/issue-74082.rs:3:8 | ||
| | ||
LL | #[repr(i128)] | ||
| ^^^^ | ||
LL | struct Foo; | ||
| ----------- not an enum | ||
|
||
error[E0517]: attribute should be applied to enum | ||
--> $DIR/issue-74082.rs:6:8 | ||
| | ||
LL | #[repr(u128)] | ||
| ^^^^ | ||
LL | struct Bar; | ||
| ----------- not an enum | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0517`. |