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

@@ -74,22 +74,21 @@ impl IntercrateAmbiguityCause {
match self {
IntercrateAmbiguityCause::DownstreamCrate { trait_desc, self_desc } => {
let self_desc = if let Some(ty) = self_desc {
format!(" for type `{}`", ty)
format!(" for type `{ty}`")
} else {
String::new()
};
format!("downstream crates may implement trait `{}`{}", trait_desc, self_desc)
format!("downstream crates may implement trait `{trait_desc}`{self_desc}")
}
IntercrateAmbiguityCause::UpstreamCrateUpdate { trait_desc, self_desc } => {
let self_desc = if let Some(ty) = self_desc {
format!(" for type `{}`", ty)
format!(" for type `{ty}`")
} else {
String::new()
};
format!(
"upstream crates may add a new impl of trait `{}`{} \
in future versions",
trait_desc, self_desc
"upstream crates may add a new impl of trait `{trait_desc}`{self_desc} \
in future versions"
)
}
IntercrateAmbiguityCause::ReservationImpl { message } => message.clone(),
@@ -2410,8 +2409,7 @@ impl<'tcx> SelectionContext<'_, 'tcx> {
let guar = self.infcx.tcx.sess.delay_span_bug(
obligation.cause.span,
format!(
"Impl {:?} was matchable against {:?} but now is not",
impl_def_id, obligation
"Impl {impl_def_id:?} was matchable against {obligation:?} but now is not"
),
);
let value = self.infcx.fresh_args_for_item(obligation.cause.span, impl_def_id);