]> git.lizzy.rs Git - rust.git/blob - src/test/ui/hygiene/cross-crate-define-and-use.rs
Merge commit '0eff589afc83e21a03a168497bbab6b4dfbb4ef6' into clippyup
[rust.git] / src / test / 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 }