1
Fork 0

Fix uninlined_format_args for some compiler crates

Convert all the crates that have had their diagnostic migration
completed (except save_analysis because that will be deleted soon and
apfloat because of the licensing problem).
This commit is contained in:
nils 2022-12-19 10:31:55 +01:00 committed by Nilstrieb
parent 1d284af117
commit fd7a159710
91 changed files with 287 additions and 329 deletions

View file

@ -90,8 +90,7 @@ pub fn parse_cfgspecs(cfgspecs: Vec<String>) -> FxHashSet<(String, Option<String
.into_iter()
.map(|s| {
let sess = ParseSess::with_silent_emitter(Some(format!(
"this error occurred on the command line: `--cfg={}`",
s
"this error occurred on the command line: `--cfg={s}`"
)));
let filename = FileName::cfg_spec_source_code(&s);
@ -150,8 +149,7 @@ pub fn parse_check_cfg(specs: Vec<String>) -> CheckCfg {
'specs: for s in specs {
let sess = ParseSess::with_silent_emitter(Some(format!(
"this error occurred on the command line: `--check-cfg={}`",
s
"this error occurred on the command line: `--check-cfg={s}`"
)));
let filename = FileName::cfg_spec_source_code(&s);

View file

@ -620,7 +620,7 @@ fn write_out_deps(
// prevents `make` from spitting out an error if a file is later
// deleted. For more info see #28735
for path in files {
writeln!(file, "{}:", path)?;
writeln!(file, "{path}:")?;
}
// Emit special comments with information about accessed environment variables.
@ -633,9 +633,9 @@ fn write_out_deps(
envs.sort_unstable();
writeln!(file)?;
for (k, v) in envs {
write!(file, "# env-dep:{}", k)?;
write!(file, "# env-dep:{k}")?;
if let Some(v) = v {
write!(file, "={}", v)?;
write!(file, "={v}")?;
}
writeln!(file)?;
}

View file

@ -205,13 +205,13 @@ pub(crate) fn run_in_thread_pool_with_globals<F: FnOnce() -> R + Send, R: Send>(
fn load_backend_from_dylib(path: &Path) -> MakeBackendFn {
let lib = unsafe { Library::new(path) }.unwrap_or_else(|err| {
let err = format!("couldn't load codegen backend {:?}: {}", path, err);
let err = format!("couldn't load codegen backend {path:?}: {err}");
early_error(ErrorOutputType::default(), &err);
});
let backend_sym = unsafe { lib.get::<MakeBackendFn>(b"__rustc_codegen_backend") }
.unwrap_or_else(|e| {
let err = format!("couldn't load codegen backend: {}", e);
let err = format!("couldn't load codegen backend: {e}");
early_error(ErrorOutputType::default(), &err);
});
@ -304,8 +304,7 @@ fn get_codegen_sysroot(maybe_sysroot: &Option<PathBuf>, backend_name: &str) -> M
.join("\n* ");
let err = format!(
"failed to find a `codegen-backends` folder \
in the sysroot candidates:\n* {}",
candidates
in the sysroot candidates:\n* {candidates}"
);
early_error(ErrorOutputType::default(), &err);
});
@ -325,7 +324,7 @@ fn get_codegen_sysroot(maybe_sysroot: &Option<PathBuf>, backend_name: &str) -> M
let expected_names = &[
format!("rustc_codegen_{}-{}", backend_name, env!("CFG_RELEASE")),
format!("rustc_codegen_{}", backend_name),
format!("rustc_codegen_{backend_name}"),
];
for entry in d.filter_map(|e| e.ok()) {
let path = entry.path();
@ -354,7 +353,7 @@ fn get_codegen_sysroot(maybe_sysroot: &Option<PathBuf>, backend_name: &str) -> M
match file {
Some(ref s) => load_backend_from_dylib(s),
None => {
let err = format!("unsupported builtin codegen backend `{}`", backend_name);
let err = format!("unsupported builtin codegen backend `{backend_name}`");
early_error(ErrorOutputType::default(), &err);
}
}
@ -389,7 +388,7 @@ pub(crate) fn check_attr_crate_type(
BuiltinLintDiagnostics::UnknownCrateTypes(
span,
"did you mean".to_string(),
format!("\"{}\"", candidate),
format!("\"{candidate}\""),
),
);
} else {