Fix useless_attribute FP on exported_private_dependencies lint attributes#16470
Fix useless_attribute FP on exported_private_dependencies lint attributes#16470samueltardieu merged 1 commit intorust-lang:masterfrom
useless_attribute FP on exported_private_dependencies lint attributes#16470Conversation
|
rustbot has assigned @samueltardieu. Use |
|
If you don't link to an issue, please describe what the problem is. |
|
|
||
| // don't lint on exported_private_dependencies for `use` items | ||
| #[allow(exported_private_dependencies)] | ||
| use {}; |
There was a problem hiding this comment.
What bothers me a bit here is that this line wouldn't raise exported_private_dependencies (an expect instead of allow would fail), so the attribute would be useless here. Could you come up with an example where this attribute is useful and should not be warned about by Clippy?
There was a problem hiding this comment.
This will require modifying the UI test suite so that at least one of its --extern dependencies is marked priv, which is an unstable feature. Is that acceptable? If so, how should that be done? I took a look at compile-test.rs but I got lost and could not determine where the cargo invocation that pulls in the contents of clippy_test_deps actually occurs so that I could add -Zpublic-dependency to that cargo invocation (as opposed to the clippy-driver invocation).
There was a problem hiding this comment.
Indeed, this is overkill. No need to change. Thanks for looking it up!
|
Reminder, once the PR becomes ready for a review, use |
I have updated the PR description. |
The
exported_private_dependencieslint can fire on any mention of an item from a private dependency, including mentions inside ofuse. Therefore,useless_attributeshould not fire on lint attributes mentioningexported_private_dependenciesattached to ause.changelog: [
useless_attribute]: fix false positive onexported_private_dependencieslint attributesPR #15645 was used as an example for preparing this PR.