summaryrefslogtreecommitdiffstats
path: root/tests/ui/parser/issues/issue-65122-mac-invoc-in-mut-patterns.rs
blob: 30f3781bf7743c5af43c1e324a7715ddf1726729 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Regression test; used to ICE with 'visit_mac_call disabled by default' due to a
// `MutVisitor` in `fn make_all_value_bindings_mutable` (`parse/parser/pat.rs`).

macro_rules! mac1 {
    ($eval:expr) => {
        let mut $eval = ();
        //~^ ERROR `mut` must be followed by a named binding
    };
}

macro_rules! mac2 {
    ($eval:pat) => {
        let mut $eval = ();
        //~^ ERROR `mut` must be followed by a named binding
        //~| ERROR expected identifier, found `does_not_exist!()`
    };
}

fn foo() {
    mac1! { does_not_exist!() }
    //~^ ERROR cannot find macro `does_not_exist` in this scope
    mac2! { does_not_exist!() }
    //~^ ERROR cannot find macro `does_not_exist` in this scope
}

fn main() {}