-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)A-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`Area: Suggestions generated by the compiler applied by `cargo fix`
Description
Consider a directory for a crate mycrate
:
src
- lib.rs
- foo.rs
foo.rs
declares a macro_rules! makro
macro and #[macro_export]
s it.
In a separate crate, a user writes:
use mycrate::foo::makro; // error: cannot find macro `makro!` in this scope
This is because #[macro_export]
exports the macro in the crate root rather than the module in which it is defined.
It's very difficult to debug this if you're not aware of this behaviour. It would be really helpful to have a suggestion to replace the suggestion with use mycrate::makro;
, or have a message saying that makro
exists in mycrate
(ideally with some background information describing the problem).
estebank, ds84182, real-felix and colejohnson66
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)A-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`Area: Suggestions generated by the compiler applied by `cargo fix`