]> git.proxmox.com Git - rustc.git/blobdiff - src/tools/clippy/tests/ui/create_dir.fixed
New upstream version 1.52.1+dfsg1
[rustc.git] / src / tools / clippy / tests / ui / create_dir.fixed
diff --git a/src/tools/clippy/tests/ui/create_dir.fixed b/src/tools/clippy/tests/ui/create_dir.fixed
new file mode 100644 (file)
index 0000000..8ed53a5
--- /dev/null
@@ -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");
+}