rust/tests/ui/hygiene/cross-crate-define-and-use.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
445 B
Rust
Raw Normal View History

2021-10-28 15:48:39 -05:00
// Check that a marco from another crate can define an item in one expansion
// and use it from another, without it being visible to everyone.
// This requires that the definition of `my_struct` preserves the hygiene
// information for the tokens in its definition.
2021-10-23 06:06:58 -05:00
// check-pass
// aux-build:use_by_macro.rs
extern crate use_by_macro;
use use_by_macro::*;
enum MyStruct {}
my_struct!(define);
fn main() {
let x = my_struct!(create);
}