summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/create_dir.fixed
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/clippy/tests/ui/create_dir.fixed')
-rw-r--r--src/tools/clippy/tests/ui/create_dir.fixed17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/create_dir.fixed b/src/tools/clippy/tests/ui/create_dir.fixed
new file mode 100644
index 000000000..8ed53a56a
--- /dev/null
+++ b/src/tools/clippy/tests/ui/create_dir.fixed
@@ -0,0 +1,17 @@
+// run-rustfix
+#![allow(unused_must_use)]
+#![warn(clippy::create_dir)]
+
+use std::fs::create_dir_all;
+
+fn create_dir() {}
+
+fn main() {
+ // Should be warned
+ create_dir_all("foo");
+ create_dir_all("bar").unwrap();
+
+ // Shouldn't be warned
+ create_dir();
+ std::fs::create_dir_all("foobar");
+}