]> git.lizzy.rs Git - rust.git/blob - src/test/ui/hygiene/nested_macro_privacy.rs
Rollup merge of #90202 - matthewjasper:xcrate-hygiene, r=petrochenkov
[rust.git] / src / test / ui / hygiene / nested_macro_privacy.rs
1 #![feature(decl_macro)]
2
3 macro n($foo:ident, $S:ident, $i:ident, $m:ident) {
4     mod $foo {
5         #[derive(Default)]
6         pub struct $S { $i: u32 }
7         pub macro $m($e:expr) { $e.$i }
8     }
9 }
10
11 n!(foo, S, i, m);
12
13 fn main() {
14     use foo::{S, m};
15     S::default().i; //~ ERROR field `i` of struct `S` is private
16     m!(S::default()); // ok
17 }