@@ -7,20 +7,26 @@ LL | fs::write(Path::new("foo.txt"), "foo");
7
7
= note: `-D clippy::needless-path-new` implied by `-D warnings`
8
8
= help: to override `-D warnings` add `#[allow(clippy::needless_path_new)]`
9
9
10
+ error: the expression enclosed in `Path::new` implements `AsRef<Path>`
11
+ --> tests/ui/needless_path_new.rs:31:9
12
+ |
13
+ LL | Path::new("bar"),
14
+ | ^^^^^^^^^^^^^^^^ help: remove the enclosing `Path::new`: `"bar"`
15
+
10
16
error: the expression enclosed in `Path::new` implements `AsRef<Path>`
11
17
--> tests/ui/needless_path_new.rs:30:9
12
18
|
13
19
LL | Path::new("foo"),
14
20
| ^^^^^^^^^^^^^^^^ help: remove the enclosing `Path::new`: `"foo"`
15
21
16
22
error: the expression enclosed in `Path::new` implements `AsRef<Path>`
17
- --> tests/ui/needless_path_new.rs:31 :9
23
+ --> tests/ui/needless_path_new.rs:38 :9
18
24
|
19
25
LL | Path::new("bar"),
20
26
| ^^^^^^^^^^^^^^^^ help: remove the enclosing `Path::new`: `"bar"`
21
27
22
28
error: the expression enclosed in `Path::new` implements `AsRef<Path>`
23
- --> tests/ui/needless_path_new.rs:38 :9
29
+ --> tests/ui/needless_path_new.rs:44 :9
24
30
|
25
31
LL | Path::new("bar"),
26
32
| ^^^^^^^^^^^^^^^^ help: remove the enclosing `Path::new`: `"bar"`
@@ -32,10 +38,10 @@ LL | Path::new("foo"),
32
38
| ^^^^^^^^^^^^^^^^ help: remove the enclosing `Path::new`: `"foo"`
33
39
34
40
error: the expression enclosed in `Path::new` implements `AsRef<Path>`
35
- --> tests/ui/needless_path_new.rs:44:9
41
+ --> tests/ui/needless_path_new.rs:49:7
36
42
|
37
- LL | Path::new("bar"),
38
- | ^^^^^^^^^^^^^^^^ help: remove the enclosing `Path::new`: `"bar "`
43
+ LL | a( Path::new("foo.txt"));
44
+ | ^^^^^^^^^^^^^^^^^^^^ help: remove the enclosing `Path::new`: `"foo.txt "`
39
45
40
- error: aborting due to 6 previous errors
46
+ error: aborting due to 7 previous errors
41
47
0 commit comments