]> git.proxmox.com Git - rustc.git/blobdiff - src/tools/clippy/lintcheck/src/main.rs
New upstream version 1.62.1+dfsg1
[rustc.git] / src / tools / clippy / lintcheck / src / main.rs
index 9af8dcc7726f080906adcc1c8ed2b1bc2b711175..816efbdaedf36d770aab843378175781f4274fb6 100644 (file)
@@ -8,6 +8,7 @@
 #![allow(clippy::collapsible_else_if)]
 
 use std::ffi::OsStr;
+use std::fmt::Write as _;
 use std::process::Command;
 use std::sync::atomic::{AtomicUsize, Ordering};
 use std::{collections::HashMap, io::ErrorKind};
@@ -110,11 +111,12 @@ impl ClippyWarning {
             let lint = format!("`{}`", self.linttype);
 
             let mut output = String::from("| ");
-            output.push_str(&format!(
+            let _ = write!(
+                output,
                 "[`{}`](../target/lintcheck/sources/{}#L{})",
                 file_with_pos, file, self.line
-            ));
-            output.push_str(&format!(r#" | {:<50} | "{}" |"#, lint, self.message));
+            );
+            let _ = write!(output, r#" | {:<50} | "{}" |"#, lint, self.message);
             output.push('\n');
             output
         } else {
@@ -304,7 +306,7 @@ impl Crate {
         let shared_target_dir = clippy_project_root().join("target/lintcheck/shared_target_dir");
 
         let mut args = if fix {
-            vec!["--fix", "--allow-no-vcs", "--"]
+            vec!["--fix", "--"]
         } else {
             vec!["--", "--message-format=json", "--"]
         };
@@ -391,7 +393,7 @@ struct LintcheckConfig {
     lintcheck_results_path: PathBuf,
     /// whether to just run --fix and not collect all the warnings
     fix: bool,
-    /// A list of lint that this lintcheck run shound focus on
+    /// A list of lints that this lintcheck run should focus on
     lint_filter: Vec<String>,
     /// Indicate if the output should support markdown syntax
     markdown: bool,
@@ -835,10 +837,11 @@ pub fn main() {
         text.push_str("| file | lint | message |\n");
         text.push_str("| --- | --- | --- |\n");
     }
-    text.push_str(&format!("{}", all_msgs.join("")));
+    write!(text, "{}", all_msgs.join(""));
     text.push_str("\n\n### ICEs:\n");
-    ices.iter()
-        .for_each(|(cratename, msg)| text.push_str(&format!("{}: '{}'", cratename, msg)));
+    for (cratename, msg) in ices.iter() {
+        let _ = write!(text, "{}: '{}'", cratename, msg);
+    }
 
     println!("Writing logs to {}", config.lintcheck_results_path.display());
     std::fs::create_dir_all(config.lintcheck_results_path.parent().unwrap()).unwrap();