2015-10-26 21:09:12 +03: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-15 00:51:46 +03:00
|
|
|
if let C1(..) = 0 {} //~ ERROR expected tuple struct/variant, found constant `C1`
|
|
|
|
if let S::C2(..) = 0 {}
|
2016-10-27 05:17:42 +03:00
|
|
|
//~^ ERROR expected tuple struct/variant, found associated constant `<S>::C2`
|
2015-10-26 21:09:12 +03:00
|
|
|
}
|