rust/tests/ui/macros/vec-macro-in-pattern.rs
Ralf Jung 5e65109f21 add write_box_via_move intrinsic and use it for vec!
This allows us to get rid of box_new entirely
2026-02-16 17:27:40 +01:00

12 lines
409 B
Rust

// This is a regression test for #61933
// Verify that the vec![] macro may not be used in patterns
// and that the resulting diagnostic is actually helpful.
fn main() {
match Some(vec![42]) {
Some(vec![43]) => {} //~ ERROR expected a pattern, found a function call
//~| ERROR found associated function
//~| ERROR expected a pattern, found a function call
_ => {}
}
}