]> git.lizzy.rs Git - rust.git/blob - src/test/ui/union/union-macro.rs
Rollup merge of #86123 - Aaron1011:query-span, r=cjgillot
[rust.git] / src / test / ui / union / union-macro.rs
1 // run-pass
2 // revisions: mirunsafeck thirunsafeck
3 // [thirunsafeck]compile-flags: -Z thir-unsafeck
4
5 #![allow(unused_variables)]
6
7 macro_rules! duplicate {
8    ($i: item) => {
9         mod m1 {
10             $i
11         }
12         mod m2 {
13             $i
14         }
15    }
16 }
17
18 duplicate! {
19     pub union U {
20         pub a: u8
21     }
22 }
23
24 fn main() {
25     let u1 = m1::U { a: 0 };
26     let u2 = m2::U { a: 0 };
27 }