|
| 1 | +//@ aux-build:tracing.rs |
| 2 | +//@ compile-flags: --crate-type=lib |
| 3 | + |
| 4 | +#![feature(register_tool)] |
| 5 | + |
| 6 | +/* tool prelude */ |
| 7 | +#![register_tool(instrument)] // macro_use prelude |
| 8 | +#![register_tool(must_use)] // lang prelude |
| 9 | +#![register_tool(Copy)] // library prelude (no extern prelude) |
| 10 | + |
| 11 | +/* extern prelude */ |
| 12 | +extern crate tracing as usize; // lang prelude |
| 13 | +extern crate tracing as Option; // libs prelude |
| 14 | +extern crate tracing as instrument; // macro_use prelude |
| 15 | + |
| 16 | +/* macro_use prelude */ |
| 17 | +#[macro_use] |
| 18 | +extern crate tracing; // also extern prelude |
| 19 | + |
| 20 | +/* lang and libs implicitly in scope */ |
| 21 | + |
| 22 | +// tool/extern -> extern |
| 23 | +// NOTE: macro_use/libs/lang not tested (not present) |
| 24 | +#[tracing::inner::some_macro] //~ ERROR `inner` is private |
| 25 | +fn foo() {} |
| 26 | + |
| 27 | +// tool/lang -> tool (no possible conflict) |
| 28 | +// NOTE: macro_use/libs/extern not tested (not present) |
| 29 | +#[must_use::inner] // ok |
| 30 | +fn f() {} |
| 31 | + |
| 32 | +// tool/libs -> tool |
| 33 | +// NOTE: extern/lang/macro not tested (not present) |
| 34 | +#[Copy::not_real] // ok |
| 35 | +fn b() {} |
| 36 | + |
| 37 | +// tool/extern/macro_use -> extern |
| 38 | +// NOTE: lang/libs not tested (not present) |
| 39 | +#[instrument::inner] //~ ERROR could not find `inner` |
| 40 | +fn a() {} |
| 41 | + |
| 42 | +// extern/lang -> lang |
| 43 | +// NOTE: macro_use/libs/tool not tested (different namespace/not present/wrong context) |
| 44 | +fn bar() -> usize { // ok |
| 45 | + 0 |
| 46 | +} |
| 47 | + |
| 48 | +// extern/libs -> extern |
| 49 | +// NOTE: macro_use/lang/tool not tested (not present) |
| 50 | +fn baz() -> Option<i32> { //~ ERROR: expected type, found crate |
| 51 | + 0 |
| 52 | +} |
| 53 | + |
| 54 | +// macro/lang -> ambiguous |
| 55 | +// NOTE: tool/libs/extern not tested (not present) |
| 56 | +#[deprecated] //~ ERROR ambiguous |
| 57 | +fn e() {} |
| 58 | + |
| 59 | +// macro/libs -> macro |
| 60 | +// NOTE: tool/lang/extern not tested (not present) |
| 61 | +#[Iterator] //~ ERROR derive macro |
| 62 | +fn d() {} |
| 63 | + |
| 64 | +// lang/libs -> lang |
| 65 | +// NOTE: tool/extern/macro not tested (not present) |
| 66 | +#[cfg(FALSE)] // ok |
| 67 | +fn g() {} |
0 commit comments