-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #10392 - mkrasnitski:false-positives, r=Jarcho
Fix more false positives for `extra_unused_type_parameters` Builds on #10321. All empty functions are no longer linted, instead of just those that have trait bounds on them. Also, if a trait bound contains a non-public trait (un-exported, but still potentially reachable), then the corresponding type parameter isn't linted. Finally, added support for the `avoid_breaking_exported_api` config option. r? `@flip1995` changelog: none
- Loading branch information
Showing
8 changed files
with
122 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,75 @@ | ||
error: type parameter goes unused in function definition | ||
--> $DIR/extra_unused_type_parameters.rs:4:13 | ||
| | ||
LL | fn unused_ty<T>(x: u8) {} | ||
LL | fn unused_ty<T>(x: u8) { | ||
| ^^^ | ||
| | ||
= help: consider removing the parameter | ||
= note: `-D clippy::extra-unused-type-parameters` implied by `-D warnings` | ||
|
||
error: type parameters go unused in function definition | ||
--> $DIR/extra_unused_type_parameters.rs:6:16 | ||
--> $DIR/extra_unused_type_parameters.rs:8:16 | ||
| | ||
LL | fn unused_multi<T, U>(x: u8) {} | ||
LL | fn unused_multi<T, U>(x: u8) { | ||
| ^^^^^^ | ||
| | ||
= help: consider removing the parameters | ||
|
||
error: type parameter goes unused in function definition | ||
--> $DIR/extra_unused_type_parameters.rs:8:23 | ||
--> $DIR/extra_unused_type_parameters.rs:12:23 | ||
| | ||
LL | fn unused_with_lt<'a, T>(x: &'a u8) {} | ||
LL | fn unused_with_lt<'a, T>(x: &'a u8) { | ||
| ^ | ||
| | ||
= help: consider removing the parameter | ||
|
||
error: type parameter goes unused in function definition | ||
--> $DIR/extra_unused_type_parameters.rs:18:19 | ||
--> $DIR/extra_unused_type_parameters.rs:24:19 | ||
| | ||
LL | fn unused_bounded<T: Default, U>(x: U) { | ||
| ^^^^^^^^^^^ | ||
| | ||
= help: consider removing the parameter | ||
|
||
error: type parameter goes unused in function definition | ||
--> $DIR/extra_unused_type_parameters.rs:22:24 | ||
--> $DIR/extra_unused_type_parameters.rs:28:24 | ||
| | ||
LL | fn unused_where_clause<T, U>(x: U) | ||
| ^^ | ||
| | ||
= help: consider removing the parameter | ||
|
||
error: type parameters go unused in function definition | ||
--> $DIR/extra_unused_type_parameters.rs:29:16 | ||
--> $DIR/extra_unused_type_parameters.rs:35:16 | ||
| | ||
LL | fn some_unused<A, B, C, D: Iterator<Item = (B, C)>, E>(b: B, c: C) { | ||
| ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^ | ||
| | ||
= help: consider removing the parameters | ||
|
||
error: type parameter goes unused in function definition | ||
--> $DIR/extra_unused_type_parameters.rs:54:22 | ||
--> $DIR/extra_unused_type_parameters.rs:60:22 | ||
| | ||
LL | fn unused_ty_impl<T>(&self) {} | ||
LL | fn unused_ty_impl<T>(&self) { | ||
| ^^^ | ||
| | ||
= help: consider removing the parameter | ||
|
||
error: type parameters go unused in function definition | ||
--> $DIR/extra_unused_type_parameters.rs:74:17 | ||
--> $DIR/extra_unused_type_parameters.rs:82:17 | ||
| | ||
LL | fn unused_opaque<A, B>(dummy: impl Default) {} | ||
LL | fn unused_opaque<A, B>(dummy: impl Default) { | ||
| ^^^^^^ | ||
| | ||
= help: consider removing the parameters | ||
|
||
error: aborting due to 8 previous errors | ||
error: type parameter goes unused in function definition | ||
--> $DIR/extra_unused_type_parameters.rs:95:58 | ||
| | ||
LL | fn unused_with_priv_trait_bound<T: private::Private, U>() { | ||
| ^ | ||
| | ||
= help: consider removing the parameter | ||
|
||
error: aborting due to 9 previous errors | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.