Closed
Description
Minimal reproduction:
// src/lib.rs
#![feature(decl_macro)]
pub macro use_fmt {
() => {
use std::fmt;
}
}
// examples/test.rs
#![feature(use_extern_macros)]
extern crate macro_test;
use macro_test::use_fmt;
use_fmt!();
fn main() {}
The error:
$ cargo build --example test
Compiling macro-test v0.1.0 (file:///.../macro-test)
error[E0432]: unresolved import `std::fmt`
--> examples/test.rs:7:1
|
7 | use_fmt!();
| ^^^^^^^^^^^ Could not find `std` in `{{root}}`
|
= note: this error originates in a macro outside of the current crate
error: aborting due to previous error(s)
error: Could not compile `macro-test`.
Invoking the macro in the same crate as it's defined works as expected.
cc @jseyfried