]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/enum-discr-type-err.rs
Do not suggest `let_else` if no bindings would be introduced
[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             //~| ERROR mismatched types
21         }
22     }
23 }
24
25 mac! {
26     A = F,
27     B = T,
28 }
29
30 fn main() {}