]> git.lizzy.rs Git - rust.git/blob - tests/ui/parser/issues/issue-65122-mac-invoc-in-mut-patterns.rs
Rollup merge of #107608 - P1n3appl3:master, r=tmandry
[rust.git] / tests / ui / parser / issues / issue-65122-mac-invoc-in-mut-patterns.rs
1 // Regression test; used to ICE with 'visit_mac_call disabled by default' due to a
2 // `MutVisitor` in `fn make_all_value_bindings_mutable` (`parse/parser/pat.rs`).
3
4 macro_rules! mac1 {
5     ($eval:expr) => {
6         let mut $eval = ();
7         //~^ ERROR `mut` must be followed by a named binding
8     };
9 }
10
11 macro_rules! mac2 {
12     ($eval:pat) => {
13         let mut $eval = ();
14         //~^ ERROR `mut` must be followed by a named binding
15         //~| ERROR expected identifier, found `does_not_exist!()`
16     };
17 }
18
19 fn foo() {
20     mac1! { does_not_exist!() }
21     //~^ ERROR cannot find macro `does_not_exist` in this scope
22     mac2! { does_not_exist!() }
23     //~^ ERROR cannot find macro `does_not_exist` in this scope
24 }
25
26 fn main() {}