redundant_pub_crate
false positive on local macros
#8756
Labels
C-bug
Category: Clippy is not doing the correct thing
I-false-positive
Issue: The lint was triggered on code it shouldn't have
I-suggestion-causes-error
Issue: The suggestions provided by this Lint cause an ICE/error when applied
Summary
This is similar to #8732, but it triggers even without a re-export. Here we are defining a module-scoped macro
foo
inside private moduletest
, and the error message says that it is apub(crate)
macro (which is false, you can't access the macro from another file even iftest
was pub because it is not#[macro_export]
), and you should usepub
instead (which does not match the intended meaning of the code, it's a private macro) (and this is also not syntactically correct,pub macro_rules!
is not legal).Lint Name
redundant_pub_crate
Reproducer
I tried this code:
I saw this happen:
Version
Additional Labels
@rustbot label +I-suggestion-causes-error
The text was updated successfully, but these errors were encountered: