Skip to content

Commit e94e936

Browse files
committed
Rebase successful?
1 parent 0e94b16 commit e94e936

File tree

2 files changed

+23
-4
lines changed

2 files changed

+23
-4
lines changed

tests/ui/join_absolute_paths.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,16 @@ fn main() {
77
// should be linted
88
let path = Path::new("/bin");
99
path.join("/sh");
10-
println!("{}", path.display());
1110

1211
//should be linted
1312
let path = Path::new("C:\\Users");
1413
path.join("\\user");
15-
println!("{}", path.display());
1614

1715
// should not be linted
1816
let path: &[&str] = &["/bin"];
1917
path.join("/sh");
20-
println!("{:?}", path);
2118

2219
//should not be linted
2320
let path = Path::new("/bin");
2421
path.join("sh");
25-
println!("{}", path.display());
2622
}

tests/ui/join_absolute_paths.stderr

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
error: argument to `Path::join` starts with a path separator
2+
--> $DIR/join_absolute_paths.rs:8:15
3+
|
4+
LL | path.join("/sh");
5+
| ^^^^^
6+
|
7+
= note: joining a path starting with separator will replace the path instead
8+
= help: if this is unintentional, try removing the starting separator
9+
= help: if this is intentional, try creating a new Path instead
10+
= note: `-D clippy::join-absolute-paths` implied by `-D warnings`
11+
12+
error: argument to `Path::join` starts with a path separator
13+
--> $DIR/join_absolute_paths.rs:12:15
14+
|
15+
LL | path.join("//user");
16+
| ^^^^^^^^
17+
|
18+
= note: joining a path starting with separator will replace the path instead
19+
= help: if this is unintentional, try removing the starting separator
20+
= help: if this is intentional, try creating a new Path instead
21+
22+
error: aborting due to 2 previous errors
23+

0 commit comments

Comments
 (0)