1
Fork 0

inline format!() args from rustc_codegen_llvm to the end (4)

r? @WaffleLapkin
This commit is contained in:
Matthias Krüger 2023-07-25 23:17:39 +02:00
parent 8327047b23
commit c64ef5e070
94 changed files with 385 additions and 498 deletions

View file

@ -171,8 +171,7 @@ fn visit_implementation_of_dispatch_from_dyn(tcx: TyCtxt<'_>, impl_did: LocalDef
create_err(&format!(
"the trait `DispatchFromDyn` may only be implemented \
for a coercion between structures with the same \
definition; expected `{}`, found `{}`",
source_path, target_path,
definition; expected `{source_path}`, found `{target_path}`",
))
.emit();

View file

@ -148,8 +148,7 @@ impl<'tcx> InherentCollect<'tcx> {
if let ty::Ref(_, subty, _) = ty.kind() {
err.note(format!(
"you could also try moving the reference to \
uses of `{}` (such as `self`) within the implementation",
subty
uses of `{subty}` (such as `self`) within the implementation"
));
}
err.emit();

View file

@ -77,8 +77,8 @@ impl<'tcx> InherentOverlapChecker<'tcx> {
"duplicate definitions with name `{}`",
ident,
);
err.span_label(span, format!("duplicate definitions for `{}`", ident));
err.span_label(*former, format!("other definition for `{}`", ident));
err.span_label(span, format!("duplicate definitions for `{ident}`"));
err.span_label(*former, format!("other definition for `{ident}`"));
err.emit();
}
@ -114,11 +114,11 @@ impl<'tcx> InherentOverlapChecker<'tcx> {
);
err.span_label(
self.tcx.def_span(item1.def_id),
format!("duplicate definitions for `{}`", name),
format!("duplicate definitions for `{name}`"),
);
err.span_label(
self.tcx.def_span(item2.def_id),
format!("other definition for `{}`", name),
format!("other definition for `{name}`"),
);
for cause in &overlap.intercrate_ambiguity_causes {

View file

@ -412,9 +412,8 @@ fn emit_orphan_check_error<'tcx>(
.span_label(
sp,
format!(
"type parameter `{}` must be covered by another type \
when it appears before the first local type (`{}`)",
param_ty, local_type
"type parameter `{param_ty}` must be covered by another type \
when it appears before the first local type (`{local_type}`)"
),
)
.note(
@ -441,9 +440,8 @@ fn emit_orphan_check_error<'tcx>(
.span_label(
sp,
format!(
"type parameter `{}` must be used as the type parameter for some \
"type parameter `{param_ty}` must be used as the type parameter for some \
local type",
param_ty,
),
)
.note(
@ -541,17 +539,16 @@ fn lint_auto_trait_impl<'tcx>(
let self_descr = tcx.def_descr(self_type_did);
match arg {
ty::util::NotUniqueParam::DuplicateParam(arg) => {
lint.note(format!("`{}` is mentioned multiple times", arg));
lint.note(format!("`{arg}` is mentioned multiple times"));
}
ty::util::NotUniqueParam::NotParam(arg) => {
lint.note(format!("`{}` is not a generic parameter", arg));
lint.note(format!("`{arg}` is not a generic parameter"));
}
}
lint.span_note(
item_span,
format!(
"try using the same sequence of generic parameters as the {} definition",
self_descr,
"try using the same sequence of generic parameters as the {self_descr} definition",
),
)
},