-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add additional test for multiple repr (#3)
Signed-off-by: Ahmed Abdelraoof <[email protected]>
- Loading branch information
Showing
2 changed files
with
28 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
use safe_discriminant::Discriminant; | ||
|
||
#[derive(Discriminant)] | ||
#[repr(u8)] | ||
#[repr(u16)] | ||
enum Foo { | ||
A = 1, | ||
B = 2, | ||
} | ||
|
||
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,17 @@ | ||
error: conflicting representation hints | ||
--> tests/fail/double_repr.rs:5:8 | ||
| | ||
5 | #[repr(u16)] | ||
| ^^^ | ||
|
||
error[E0566]: conflicting representation hints | ||
--> tests/fail/double_repr.rs:4:8 | ||
| | ||
4 | #[repr(u8)] | ||
| ^^ | ||
5 | #[repr(u16)] | ||
| ^^^ | ||
| | ||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | ||
= note: for more information, see issue #68585 <https://github.com/rust-lang/rust/issues/68585> | ||
= note: `#[deny(conflicting_repr_hints)]` on by default |