mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 06:51:58 +00:00
17 lines
342 B
Rust
17 lines
342 B
Rust
// Can't use constants as tuple struct patterns
|
|
|
|
|
|
const C1: i32 = 0;
|
|
|
|
struct S;
|
|
|
|
impl S {
|
|
const C2: i32 = 0;
|
|
}
|
|
|
|
fn main() {
|
|
if let C1(..) = 0 {} //~ ERROR expected tuple struct or tuple variant, found constant `C1`
|
|
if let S::C2(..) = 0 {}
|
|
//~^ ERROR expected tuple struct or tuple variant, found associated constant `S::C2`
|
|
}
|