Regression in decl_macro emitted item resolutions #59196
Closed
Description
On the current nightly (2019-03-13
), the following code fails (link to the playground):
#![feature(decl_macro)]
macro bar() {
pub enum Bar {
A,
B,
C
}
}
bar!();
fn main() {
let _ = Bar::A;
let _ = Bar::B;
let _ = Bar::C;
}
with the error:
error[E0433]: failed to resolve: use of undeclared type or module `Bar`
--> src/main.rs:14:13
|
14 | let _ = Bar::A;
| ^^^ use of undeclared type or module `Bar`
error[E0433]: failed to resolve: use of undeclared type or module `Bar`
--> src/main.rs:15:13
|
15 | let _ = Bar::B;
| ^^^ use of undeclared type or module `Bar`
error[E0433]: failed to resolve: use of undeclared type or module `Bar`
--> src/main.rs:16:13
|
16 | let _ = Bar::C;
| ^^^ use of undeclared type or module `Bar`
This seems to be an issue with the decl_macro
feature specifically - declaring the same macro with macro_rules
works as intended.