rust/tests/ui/macros/vec-macro-in-pattern.rs

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

13 lines
424 B
Rust
Raw Normal View History

2021-01-16 15:32:51 +00:00
// 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]) {
2025-01-02 20:22:42 +00:00
Some(vec![43]) => {} //~ ERROR expected a pattern, found a function call
//~| ERROR found associated function
//~| ERROR usage of qualified paths in this context is experimental
2021-01-16 15:32:51 +00:00
_ => {}
}
}