]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/enum-discr-type-err.rs
Rollup merge of #64603 - gilescope:unused-lifetime-warning, r=matthewjasper
[rust.git] / src / test / ui / consts / enum-discr-type-err.rs
1 // Test that we mark enum discriminant values as having errors, even when the
2 // diagnostic is deduplicated.
3
4 struct F;
5 struct T;
6
7 impl F {
8     const V: i32 = 0;
9 }
10
11 impl T {
12     const V: i32 = 0;
13 }
14
15 macro_rules! mac {
16     ($( $v: ident = $s: ident,)*) => {
17         enum E {
18             $( $v = $s::V, )*
19             //~^ ERROR mismatched types
20         }
21     }
22 }
23
24 mac! {
25     A = F,
26     B = T,
27 }
28
29 fn main() {}