Unhelpful diagnostic when using proc macros 2.0 without #![feature(use_extern_macros)] #41334
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-macros-2.0
Area: Declarative macros 2.0 (#39412)
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
Suppose I had these two files:
When I try to compile these files with
rustc foo.rs && rustc bar.rs -L.
, I get the following errors:Now, if I follow the compiler's advice and try
#[macro_use]
instead, I'm presented with this error:But that's what I had in the first place!
The real solution to this problem is to add
#![feature(use_extern_macros)]
tobar.rs
. The compiler should suggest this instead when it encounters a function-like proc macro.The text was updated successfully, but these errors were encountered: