mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-30 20:17:50 +00:00
20 lines
270 B
Rust
20 lines
270 B
Rust
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`
|
|
}
|