@@ -10,6 +10,7 @@ fn takes_impl_path(_: impl AsRef<Path>) {}
1010fn takes_path_and_impl_path ( _: & Path , _: impl AsRef < Path > ) { }
1111
1212fn takes_two_impl_paths_with_the_same_generic < P : AsRef < Path > > ( _: P , _: P ) { }
13+ fn takes_two_impl_paths_with_different_generics < P : AsRef < Path > > ( _: P , _: P ) { }
1314
1415struct Foo ;
1516
@@ -37,8 +38,8 @@ fn main() {
3738 Path :: new ( "bar" ) , //~ needless_path_new
3839 ) ;
3940
40- // we can and should change both at the same time
41- takes_two_impl_paths_with_the_same_generic (
41+ // we can and should change both independently
42+ takes_two_impl_paths_with_different_generics (
4243 Path :: new ( "foo" ) , //~ needless_path_new
4344 Path :: new ( "bar" ) , //~ needless_path_new
4445 ) ;
@@ -58,8 +59,7 @@ fn main() {
5859 Foo :: takes_path_and_impl_path ( Path :: new ( "foo" ) , "bar" ) ;
5960 f. takes_self_and_path_and_impl_path ( Path :: new ( "foo" ) , "bar" ) ;
6061
61- fn foo ( ) -> Option < & ' static Path > {
62- // Some(...) is `ExprKind::Call`, but we don't consider it
63- Some ( Path :: new ( "foo.txt" ) )
64- }
62+ // we are conservative and don't suggest changing a parameter
63+ // if it contains a generic type used elsewhere in the function
64+ takes_two_impl_paths_with_the_same_generic ( Path :: new ( "foo" ) , Path :: new ( "bar" ) ) ;
6565}
0 commit comments