2015-10-26 13:09:12 -05:00
|
|
|
// Can't use constants as tuple struct patterns
|
|
|
|
|
|
|
|
|
|
|
|
const C1: i32 = 0;
|
|
|
|
|
|
|
|
struct S;
|
|
|
|
|
|
|
|
impl S {
|
|
|
|
const C2: i32 = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2016-09-14 16:51:46 -05:00
|
|
|
if let C1(..) = 0 {} //~ ERROR expected tuple struct/variant, found constant `C1`
|
|
|
|
if let S::C2(..) = 0 {}
|
2016-10-26 21:17:42 -05:00
|
|
|
//~^ ERROR expected tuple struct/variant, found associated constant `<S>::C2`
|
2015-10-26 13:09:12 -05:00
|
|
|
}
|