1
Fork 0

inline format!() args up to and including rustc_codegen_llvm

This commit is contained in:
Matthias Krüger 2023-07-25 23:04:01 +02:00
parent 2e0136a131
commit 3ce90b1649
72 changed files with 411 additions and 481 deletions

View file

@ -1445,12 +1445,12 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
let name_str = if name == kw::PathRoot {
"crate root".to_string()
} else {
format!("`{}`", name)
format!("`{name}`")
};
let label = if segment_idx == 1 && path[0].ident.name == kw::PathRoot {
format!("global paths cannot start with {}", name_str)
format!("global paths cannot start with {name_str}")
} else {
format!("{} in paths can only be used in start position", name_str)
format!("{name_str} in paths can only be used in start position")
};
(label, None)
});