Skip to content

Commit 5db2bf5

Browse files
committed
New UI test: zero_discriminant_deferred
1 parent c2d64de commit 5db2bf5

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
const ZERO: u8 = 0;
2+
3+
#[enumflags2::bitflags]
4+
#[derive(Copy, Clone)]
5+
#[repr(u8)]
6+
enum Foo {
7+
Zero = ZERO,
8+
}
9+
10+
#[enumflags2::bitflags]
11+
#[derive(Copy, Clone)]
12+
#[repr(u8)]
13+
enum Bar {
14+
Overflown = (ZERO + 2) << 7,
15+
}
16+
17+
fn main() {}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
error[E0277]: the trait bound `AssertionFailed: ExactlyOneBitSet` is not satisfied
2+
--> $DIR/zero_discriminant_deferred.rs:7:5
3+
|
4+
7 | Zero = ZERO,
5+
| ^^^^^^^^^^^ the trait `ExactlyOneBitSet` is not implemented for `AssertionFailed`
6+
7+
error[E0277]: the trait bound `AssertionFailed: ExactlyOneBitSet` is not satisfied
8+
--> $DIR/zero_discriminant_deferred.rs:14:5
9+
|
10+
14 | Overflown = (ZERO + 2) << 7,
11+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `ExactlyOneBitSet` is not implemented for `AssertionFailed`

0 commit comments

Comments
 (0)