rust/tests/ui/parser/issues/issue-67377-invalid-syntax-in-enum-discriminant.rs
2023-01-11 09:32:08 +00:00

36 lines
1.0 KiB
Rust

mod a {
use std::marker::PhantomData;
enum Bug {
V = [PhantomData; { [ () ].len() ].len() as isize,
//~^ ERROR mismatched closing delimiter: `]`
//~| ERROR mismatched closing delimiter: `]`
//~| ERROR mismatched closing delimiter: `]`
//~| ERROR mismatched closing delimiter: `]`
}
}
mod b {
enum Bug {
V = [Vec::new; { [].len() ].len() as isize,
//~^ ERROR mismatched closing delimiter: `]`
//~| ERROR mismatched closing delimiter: `]`
//~| ERROR mismatched closing delimiter: `]`
//~| ERROR mismatched closing delimiter: `]`
//~| ERROR type annotations needed
}
}
mod c {
enum Bug {
V = [Vec::new; { [0].len() ].len() as isize,
//~^ ERROR mismatched closing delimiter: `]`
//~| ERROR mismatched closing delimiter: `]`
//~| ERROR mismatched closing delimiter: `]`
//~| ERROR mismatched closing delimiter: `]`
//~| ERROR type annotations needed
}
}
fn main() {}