Do not trigger redundant_pub_crate
in external macros
#13952
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Some widely used crates, such as
pin-project-lite
, make use of apub(crate)
construct in a private module inside a public macro. This makes unrelated project trigger the lint.There is also an unfortunate situation for Clippy itself: when a new version of
pin-project-lite
or similar lint-trigerring crates is released, those lints which can be found in hundreds of occurrences in dependent crates will change, and appear as diffs in unrelated Clippy PR because the base lintcheck run will be cached with the ancient release of the crates. We currently have the situation here, which 219 lints removed and 219 lints added because of apin-project-lite
version change between runs, and the fact thatredundant_pub_crate
triggers on external macros.Also:
tokio::select!
triggersredundant_pub_crate
(nursery) #12213changelog: [
redundant_pub_crate
]: do not trigger on external macros