-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
private_macro_use warning needs more information #136820
Copy link
Copy link
Open
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.D-terseDiagnostics: An error or lint that doesn't give enough information about the problem at hand.Diagnostics: An error or lint that doesn't give enough information about the problem at hand.L-private_macro_useLint: private_macro_useLint: private_macro_useT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.D-terseDiagnostics: An error or lint that doesn't give enough information about the problem at hand.Diagnostics: An error or lint that doesn't give enough information about the problem at hand.L-private_macro_useLint: private_macro_useLint: private_macro_useT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Related: #120192 Tracking Issue for private_macro_use lint
The warning needs more information on why a macro is considered private, possibly with full module path. The following produces a warning with very little information to go on to figure out that it's picking up the Serialize coming from serde_with, instead of serde. Having the definition of Foo in another module makes it magic on how the Serialize is not imported. (but I would guess that's an issue with #[macro_use]
Interestingly the #[macro_use] is considered unused by the compiler as well, but removing that produces an import error (correctly).
My Cargo.toml contains: