summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/join_absolute_paths.stderr
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/clippy/tests/ui/join_absolute_paths.stderr')
-rw-r--r--src/tools/clippy/tests/ui/join_absolute_paths.stderr68
1 files changed, 68 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/join_absolute_paths.stderr b/src/tools/clippy/tests/ui/join_absolute_paths.stderr
new file mode 100644
index 000000000..0c2f89d99
--- /dev/null
+++ b/src/tools/clippy/tests/ui/join_absolute_paths.stderr
@@ -0,0 +1,68 @@
+error: argument to `Path::join` starts with a path separator
+ --> $DIR/join_absolute_paths.rs:10:15
+ |
+LL | path.join("/sh");
+ | ^^^^^
+ |
+ = note: joining a path starting with separator will replace the path instead
+ = note: `-D clippy::join-absolute-paths` implied by `-D warnings`
+ = help: to override `-D warnings` add `#[allow(clippy::join_absolute_paths)]`
+help: if this is unintentional, try removing the starting separator
+ |
+LL | path.join("sh");
+ | ~~~~
+help: if this is intentional, try using `Path::new` instead
+ |
+LL | PathBuf::from("/sh");
+ | ~~~~~~~~~~~~~~~~~~~~
+
+error: argument to `Path::join` starts with a path separator
+ --> $DIR/join_absolute_paths.rs:14:15
+ |
+LL | path.join("\\user");
+ | ^^^^^^^^
+ |
+ = note: joining a path starting with separator will replace the path instead
+help: if this is unintentional, try removing the starting separator
+ |
+LL | path.join("\user");
+ | ~~~~~~~
+help: if this is intentional, try using `Path::new` instead
+ |
+LL | PathBuf::from("\\user");
+ | ~~~~~~~~~~~~~~~~~~~~~~~
+
+error: argument to `Path::join` starts with a path separator
+ --> $DIR/join_absolute_paths.rs:18:15
+ |
+LL | path.join("/sh");
+ | ^^^^^
+ |
+ = note: joining a path starting with separator will replace the path instead
+help: if this is unintentional, try removing the starting separator
+ |
+LL | path.join("sh");
+ | ~~~~
+help: if this is intentional, try using `Path::new` instead
+ |
+LL | PathBuf::from("/sh");
+ | ~~~~~~~~~~~~~~~~~~~~
+
+error: argument to `Path::join` starts with a path separator
+ --> $DIR/join_absolute_paths.rs:22:15
+ |
+LL | path.join(r#"/sh"#);
+ | ^^^^^^^^
+ |
+ = note: joining a path starting with separator will replace the path instead
+help: if this is unintentional, try removing the starting separator
+ |
+LL | path.join(r#"sh"#);
+ | ~~~~~~~
+help: if this is intentional, try using `Path::new` instead
+ |
+LL | PathBuf::from(r#"/sh"#);
+ | ~~~~~~~~~~~~~~~~~~~~~~~
+
+error: aborting due to 4 previous errors
+