Skip to content

Commit 9c4c4a7

Browse files
committed
wip
1 parent b531630 commit 9c4c4a7

File tree

29 files changed

+74
-64
lines changed

29 files changed

+74
-64
lines changed

compiler/rustc_ast_lowering/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1607,7 +1607,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
16071607
"Unexpected lifetime resolution {:?} for {:?} at {:?}",
16081608
res, lifetime.ident, lifetime.ident.span
16091609
);
1610-
span_bug!(lifetime.ident.span, "{}", bug_msg);
1610+
span_bug!(lifetime.ident.span, "{bug_msg}");
16111611
}
16121612
};
16131613

compiler/rustc_ast_lowering/src/lifetime_collector.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ impl<'ast> LifetimeCollectVisitor<'ast> {
3838
"Unexpected lifetime resolution {:?} for {:?} at {:?}",
3939
res, lifetime.ident, lifetime.ident.span
4040
);
41-
span_bug!(lifetime.ident.span, "{}", bug_msg);
41+
span_bug!(lifetime.ident.span, "{bug_msg}");
4242
}
4343
}
4444
}

compiler/rustc_borrowck/src/constraint_generation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ impl<'cg, 'tcx> Visitor<'tcx> for ConstraintGeneration<'cg, 'tcx> {
7171
| TyContext::YieldTy(SourceInfo { span, .. })
7272
| TyContext::UserTy(span)
7373
| TyContext::LocalDecl { source_info: SourceInfo { span, .. }, .. } => {
74-
span_bug!(span, "should not be visiting outside of the CFG: {:?}", ty_context);
74+
span_bug!(span, "should not be visiting outside of the CFG: {ty_context:?}");
7575
}
7676
TyContext::Location(location) => {
7777
self.add_regular_live_constraint(ty, location);

compiler/rustc_builtin_macros/src/assert/context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ impl<'cx, 'a> Context<'cx, 'a> {
159159
} else {
160160
format!(
161161
"Assertion failed: {escaped_expr_str}\nWith captures:\n{}",
162-
&self.fmt_string
162+
self.fmt_string
163163
)
164164
}),
165165
suffix: None,

compiler/rustc_codegen_cranelift/src/common.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ impl<'tcx> LayoutOfHelpers<'tcx> for RevealAllLayoutCx<'tcx> {
480480
if let LayoutError::SizeOverflow(_) | LayoutError::ReferencesError(_) = err {
481481
self.0.sess.span_fatal(span, err.to_string())
482482
} else {
483-
span_bug!(span, "failed to get layout for `{}`: {}", ty, err)
483+
span_bug!(span, "failed to get layout for `{ty}`: {err}")
484484
}
485485
}
486486
}

compiler/rustc_codegen_cranelift/src/constant.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ pub(crate) fn eval_mir_constant<'tcx>(
107107
fx.tcx.sess.span_err(constant.span, "erroneous constant encountered");
108108
}
109109
ErrorHandled::TooGeneric => {
110-
span_bug!(constant.span, "codegen encountered polymorphic constant: {:?}", err);
110+
span_bug!(constant.span, "codegen encountered polymorphic constant: {err:?}");
111111
}
112112
})
113113
.ok();

compiler/rustc_codegen_gcc/src/context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ impl<'gcc, 'tcx> LayoutOfHelpers<'tcx> for CodegenCx<'gcc, 'tcx> {
479479
if let LayoutError::SizeOverflow(_) | LayoutError::ReferencesError(_) = err {
480480
self.sess().emit_fatal(respan(span, err.into_diagnostic()))
481481
} else {
482-
span_bug!(span, "failed to get layout for `{}`: {}", ty, err)
482+
span_bug!(span, "failed to get layout for `{ty}`: {err}")
483483
}
484484
}
485485
}

compiler/rustc_codegen_ssa/src/back/link.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -971,7 +971,7 @@ fn link_natively<'a>(
971971
sess.emit_err(errors::UnableToExeLinker {
972972
linker_path,
973973
error: e,
974-
command_formatted: format!("{:?}", &cmd),
974+
command_formatted: format!("{cmd:?}"),
975975
});
976976
}
977977

@@ -1477,7 +1477,7 @@ fn print_native_static_libs(
14771477
sess.emit_note(errors::StaticLibraryNativeArtifacts);
14781478
// Prefix for greppability
14791479
// Note: This must not be translated as tools are allowed to depend on this exact string.
1480-
sess.note_without_error(format!("native-static-libs: {}", &lib_args.join(" ")));
1480+
sess.note_without_error(format!("native-static-libs: {}", lib_args.join(" ")));
14811481
}
14821482
}
14831483
}

compiler/rustc_codegen_ssa/src/codegen_attrs.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, did: LocalDefId) -> CodegenFnAttrs {
313313
sym::link_section => {
314314
if let Some(val) = attr.value_str() {
315315
if val.as_str().bytes().any(|b| b == 0) {
316-
let msg = format!("illegal null byte in link_section value: `{}`", &val);
316+
let msg = format!("illegal null byte in link_section value: `{val}`");
317317
tcx.sess.span_err(attr.span, msg);
318318
} else {
319319
codegen_fn_attrs.link_section = Some(val);
@@ -648,7 +648,7 @@ fn check_link_ordinal(tcx: TyCtxt<'_>, attr: &ast::Attribute) -> Option<u16> {
648648
if *ordinal <= u16::MAX as u128 {
649649
Some(*ordinal as u16)
650650
} else {
651-
let msg = format!("ordinal value in `link_ordinal` is too large: `{}`", &ordinal);
651+
let msg = format!("ordinal value in `link_ordinal` is too large: `{ordinal}`");
652652
tcx.sess
653653
.struct_span_err(attr.span, msg)
654654
.note("the value may not exceed `u16::MAX`")

compiler/rustc_codegen_ssa/src/common.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ pub fn asm_const_to_str<'tcx>(
198198
ty_and_layout: TyAndLayout<'tcx>,
199199
) -> String {
200200
let ConstValue::Scalar(scalar) = const_value else {
201-
span_bug!(sp, "expected Scalar for promoted asm const, but got {:#?}", const_value)
201+
span_bug!(sp, "expected Scalar for promoted asm const, but got {const_value:#?}")
202202
};
203203
let value = scalar.assert_bits(ty_and_layout.size);
204204
match ty_and_layout.ty.kind() {

0 commit comments

Comments
 (0)