We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 189e166 commit d9d03a4Copy full SHA for d9d03a4
tests/ui/needless_path_new.rs
@@ -5,6 +5,8 @@ use std::path::Path;
5
6
fn takes_path(_: &Path) {}
7
8
+fn takes_impl_path(_: impl AsRef<Path>) {}
9
+
10
fn takes_path_and_impl_path(_: &Path, _: impl AsRef<Path>) {}
11
12
fn takes_two_impl_paths_with_the_same_generic<P: AsRef<Path>>(_: P, _: P) {}
@@ -41,6 +43,10 @@ fn main() {
41
43
Path::new("bar"), //~ needless_path_new
42
44
);
45
46
+ let a = takes_impl_path;
47
48
+ a(Path::new("foo.txt")); //~ needless_path_new
49
50
// no warning
51
takes_path(Path::new("foo"));
52
0 commit comments