Skip to content

Commit ab2913c

Browse files
authored
Add additional test for multiple repr (#3)
Signed-off-by: Ahmed Abdelraoof <[email protected]>
1 parent 51e8a7f commit ab2913c

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
use safe_discriminant::Discriminant;
2+
3+
#[derive(Discriminant)]
4+
#[repr(u8)]
5+
#[repr(u16)]
6+
enum Foo {
7+
A = 1,
8+
B = 2,
9+
}
10+
11+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
error: conflicting representation hints
2+
--> tests/fail/double_repr.rs:5:8
3+
|
4+
5 | #[repr(u16)]
5+
| ^^^
6+
7+
error[E0566]: conflicting representation hints
8+
--> tests/fail/double_repr.rs:4:8
9+
|
10+
4 | #[repr(u8)]
11+
| ^^
12+
5 | #[repr(u16)]
13+
| ^^^
14+
|
15+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
16+
= note: for more information, see issue #68585 <https://github.com/rust-lang/rust/issues/68585>
17+
= note: `#[deny(conflicting_repr_hints)]` on by default

0 commit comments

Comments
 (0)