about summary refs log tree commit diff
path: root/tests/ui/structs/ident-from-macro-expansion.rs
blob: 56d31a42561688d62cd463f16d8dc20586dc9a27 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
struct Foo {
    inner: Inner,
}

struct Inner {
    y: i32,
}

macro_rules! access {
    ($expr:expr, $ident:ident) => {
        $expr.$ident
    }
}

fn main() {
    let k = Foo { inner: Inner { y: 0 } };
    access!(k, y);
    //~^ ERROR no field `y` on type `Foo`
}