rust/tests/ui/suggestions/suppress-consider-slicing-issue-120605.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

21 lines
437 B
Rust
Raw Normal View History

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() {}