Skip to content

Commit

Permalink
Add additional test for multiple repr (#3)
Browse files Browse the repository at this point in the history
Signed-off-by: Ahmed Abdelraoof <[email protected]>
  • Loading branch information
oddcoder authored Aug 19, 2024
1 parent 51e8a7f commit ab2913c
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
11 changes: 11 additions & 0 deletions safe-discriminant/tests/fail/double_repr.rs
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() {}
17 changes: 17 additions & 0 deletions safe-discriminant/tests/fail/double_repr.stderr
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

0 comments on commit ab2913c

Please sign in to comment.