mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 23:34:48 +00:00
21 lines
437 B
Rust
21 lines
437 B
Rust
pub struct Struct {
|
|
a: Vec<Struct>,
|
|
}
|
|
|
|
impl Struct {
|
|
pub fn test(&self) {
|
|
if let [Struct { a: [] }] = &self.a {
|
|
//~^ ERROR expected an array or slice
|
|
//~| ERROR expected an array or slice
|
|
println!("matches!")
|
|
}
|
|
|
|
if let [Struct { a: [] }] = &self.a[..] {
|
|
//~^ ERROR expected an array or slice
|
|
println!("matches!")
|
|
}
|
|
}
|
|
}
|
|
|
|
fn main() {}
|