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