Skip to content

Commit 0832d1d

Browse files
RalfJungfbstj
andauthored
more use of format! variable capture
Co-authored-by: Joe ST <[email protected]>
1 parent d31cbb5 commit 0832d1d

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

compiler/rustc_const_eval/src/interpret/memory.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -306,9 +306,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
306306
}
307307
if alloc_kind != kind {
308308
throw_ub_format!(
309-
"deallocating {alloc_id:?}, which is {} memory, using {} deallocation operation",
310-
alloc_kind,
311-
kind
309+
"deallocating {alloc_id:?}, which is {alloc_kind} memory, using {kind} deallocation operation"
312310
);
313311
}
314312
if let Some((size, align)) = old_size_and_align {

compiler/rustc_middle/src/mir/interpret/error.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ impl fmt::Display for UndefinedBehaviorInfo<'_> {
357357
write!(f, "{msg}null pointer is not a valid pointer")
358358
}
359359
DanglingIntPointer(i, msg) => {
360-
write!(f, "{msg}{:#x} is not a valid pointer", i)
360+
write!(f, "{msg}{i:#x} is not a valid pointer")
361361
}
362362
AlignmentCheckFailed { required, has } => write!(
363363
f,

compiler/rustc_middle/src/mir/interpret/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ impl<'tcx> TyCtxt<'tcx> {
466466
return alloc_id;
467467
}
468468
let id = alloc_map.reserve();
469-
debug!("creating alloc {:?} with id {:?}", alloc, id);
469+
debug!("creating alloc {alloc:?} with id {id:?}");
470470
alloc_map.alloc_map.insert(id, alloc.clone());
471471
alloc_map.dedup.insert(alloc, id);
472472
id

0 commit comments

Comments
 (0)