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() {
|
2019-10-14 19:20:50 -05:00
|
|
|
if let C1(..) = 0 {} //~ ERROR expected tuple struct or tuple variant, found constant `C1`
|
2016-09-14 16:51:46 -05:00
|
|
|
if let S::C2(..) = 0 {}
|
2019-10-18 11:05:54 -05:00
|
|
|
//~^ ERROR expected tuple struct or tuple variant, found associated constant `S::C2`
|
2015-10-26 13:09:12 -05:00
|
|
|
}
|