]> git.proxmox.com Git - rustc.git/blob - tests/ui/hygiene/cross-crate-define-and-use.rs
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / ui / hygiene / cross-crate-define-and-use.rs
1 // Check that a marco from another crate can define an item in one expansion
2 // and use it from another, without it being visible to everyone.
3 // This requires that the definition of `my_struct` preserves the hygiene
4 // information for the tokens in its definition.
5
6 // check-pass
7 // aux-build:use_by_macro.rs
8
9 #![feature(type_name_of_val)]
10 extern crate use_by_macro;
11
12 use use_by_macro::*;
13
14 enum MyStruct {}
15 my_struct!(define);
16
17 fn main() {
18 let x = my_struct!(create);
19 }