]> git.lizzy.rs Git - rust.git/blobdiff - tests/fmt.rs
Make tidy check for magic numbers that spell things
[rust.git] / tests / fmt.rs
index 3aff8741f6051d7e6b95e525bc1a37812b3e2173..383702dd439cfb46acbd9c26f516adfab5d4d61c 100644 (file)
@@ -1,3 +1,6 @@
+#![cfg_attr(feature = "deny-warnings", deny(warnings))]
+#![warn(rust_2018_idioms, unused_lifetimes)]
+
 use std::path::PathBuf;
 use std::process::Command;
 
@@ -7,11 +10,8 @@ fn fmt() {
         return;
     }
 
-    // Skip this test if rustup nightly is unavailable
-    let rustup_output = Command::new("rustup")
-        .args(&["component", "list", "--toolchain", "nightly"])
-        .output()
-        .unwrap();
+    // Skip this test if nightly rustfmt is unavailable
+    let rustup_output = Command::new("rustup").args(&["component", "list"]).output().unwrap();
     assert!(rustup_output.status.success());
     let component_output = String::from_utf8_lossy(&rustup_output.stdout);
     if !component_output.contains("rustfmt") {
@@ -19,12 +19,9 @@ fn fmt() {
     }
 
     let root_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
-    let dev_dir = root_dir.join("clippy_dev");
-    let target_dir = root_dir.join("target");
-    let target_dir = target_dir.to_str().unwrap();
     let output = Command::new("cargo")
-        .current_dir(dev_dir)
-        .args(&["+nightly", "run", "--target-dir", target_dir, "--", "fmt", "--check"])
+        .current_dir(root_dir)
+        .args(&["dev", "fmt", "--check"])
         .output()
         .unwrap();