2016-05-20 13:18:30 +00:00
|
|
|
enum Enum {
|
2022-05-27 13:42:15 +00:00
|
|
|
//~^ ERROR discriminant value `3` assigned more than once
|
2017-12-10 21:12:25 +00:00
|
|
|
P = 3,
|
2022-08-07 15:24:25 +00:00
|
|
|
//~^ NOTE `3` assigned here
|
2016-08-08 06:33:05 +00:00
|
|
|
X = 3,
|
2022-08-07 15:24:25 +00:00
|
|
|
//~^ NOTE `3` assigned here
|
2016-05-20 13:18:30 +00:00
|
|
|
Y = 5
|
|
|
|
}
|
|
|
|
|
2021-07-15 19:25:11 +00:00
|
|
|
#[repr(u8)]
|
|
|
|
enum EnumOverflowRepr {
|
2022-05-27 13:42:15 +00:00
|
|
|
//~^ ERROR discriminant value `1` assigned more than once
|
2021-07-15 19:25:11 +00:00
|
|
|
P = 257,
|
2022-08-07 15:24:25 +00:00
|
|
|
//~^ NOTE `1` (overflowed from `257`) assigned here
|
2021-07-15 19:25:11 +00:00
|
|
|
X = 513,
|
2022-08-07 15:24:25 +00:00
|
|
|
//~^ NOTE `1` (overflowed from `513`) assigned here
|
2022-05-27 13:42:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[repr(i8)]
|
|
|
|
enum NegDisEnum {
|
|
|
|
//~^ ERROR discriminant value `-1` assigned more than once
|
|
|
|
First = -1,
|
2022-08-07 15:24:25 +00:00
|
|
|
//~^ NOTE `-1` assigned here
|
2022-05-27 13:42:15 +00:00
|
|
|
Second = -2,
|
2022-08-07 15:24:25 +00:00
|
|
|
//~^ NOTE discriminant for `Last` incremented from this startpoint (`Second` + 1 variant later => `Last` = -1)
|
2022-05-27 13:42:15 +00:00
|
|
|
Last,
|
2022-08-07 15:24:25 +00:00
|
|
|
//~^ NOTE `-1` assigned here
|
|
|
|
}
|
|
|
|
|
|
|
|
enum MultipleDuplicates {
|
|
|
|
//~^ ERROR discriminant value `0` assigned more than once
|
2022-08-08 19:34:55 +00:00
|
|
|
//~^^ ERROR discriminant value `-2` assigned more than once
|
2022-08-07 15:24:25 +00:00
|
|
|
V0,
|
|
|
|
//~^ NOTE `0` assigned here
|
|
|
|
V1 = 0,
|
|
|
|
//~^ NOTE `0` assigned here
|
|
|
|
V2,
|
|
|
|
V3,
|
|
|
|
V4 = 0,
|
|
|
|
//~^ NOTE `0` assigned here
|
|
|
|
V5 = -2,
|
2022-08-08 19:34:55 +00:00
|
|
|
//~^ NOTE discriminant for `V7` incremented from this startpoint (`V5` + 2 variants later => `V7` = 0)
|
|
|
|
//~^^ NOTE `-2` assigned here
|
2022-08-07 15:24:25 +00:00
|
|
|
V6,
|
|
|
|
V7,
|
|
|
|
//~^ NOTE `0` assigned here
|
2022-08-08 19:34:55 +00:00
|
|
|
V8 = -3,
|
|
|
|
//~^ NOTE discriminant for `V9` incremented from this startpoint (`V8` + 1 variant later => `V9` = -2)
|
|
|
|
V9,
|
|
|
|
//~^ NOTE `-2` assigned here
|
2021-07-15 19:25:11 +00:00
|
|
|
}
|
|
|
|
|
2016-05-20 13:18:30 +00:00
|
|
|
fn main() {
|
|
|
|
}
|