| 1 |
enum E { |
| 2 |
A(), |
| 3 |
B, |
| 4 |
} |
| 5 |
|
| 6 |
const CONST_E: E = E::A(); |
| 7 |
|
| 8 |
static static_e: E = E::A(); |
| 9 |
|
| 10 |
type type_alias = E; |
| 11 |
|
| 12 |
fn f(e: E) { |
| 13 |
match e { |
| 14 |
E::A => {} |
| 15 |
// { dg-error "expected unit struct, unit variant or constant, found tuple variant .E::A." "" { target *-*-* } .-1 } |
| 16 |
E::B => {} |
| 17 |
crate::CONST_E => {} |
| 18 |
crate::type_alias => {} |
| 19 |
// { dg-error "expected unit struct, unit variant or constant, found type alias .crate::type_alias." "" { target *-*-* } .-1 } |
| 20 |
crate::E => {} |
| 21 |
// { dg-error "expected unit struct, unit variant or constant, found enum .crate::E." "" { target *-*-* } .-1 } |
| 22 |
crate::static_e => {} |
| 23 |
// { dg-error "expected unit struct, unit variant or constant, found static .crate::static_e." "" { target *-*-* } .-1 } |
| 24 |
crate::f => {} |
| 25 |
// { dg-error "expected unit struct, unit variant or constant, found function .crate::f." "" { target *-*-* } .-1 } |
| 26 |
_ => {} |
| 27 |
} |
| 28 |
} |
| 29 |
|
| 30 |
fn main() {} |