more use of format! variable capture
Co-authored-by: Joe ST <joe@fbstj.net>
This commit is contained in:
parent
d31cbb5150
commit
0832d1d022
3 changed files with 3 additions and 5 deletions
|
@ -306,9 +306,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
|
||||||
}
|
}
|
||||||
if alloc_kind != kind {
|
if alloc_kind != kind {
|
||||||
throw_ub_format!(
|
throw_ub_format!(
|
||||||
"deallocating {alloc_id:?}, which is {} memory, using {} deallocation operation",
|
"deallocating {alloc_id:?}, which is {alloc_kind} memory, using {kind} deallocation operation"
|
||||||
alloc_kind,
|
|
||||||
kind
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if let Some((size, align)) = old_size_and_align {
|
if let Some((size, align)) = old_size_and_align {
|
||||||
|
|
|
@ -357,7 +357,7 @@ impl fmt::Display for UndefinedBehaviorInfo<'_> {
|
||||||
write!(f, "{msg}null pointer is not a valid pointer")
|
write!(f, "{msg}null pointer is not a valid pointer")
|
||||||
}
|
}
|
||||||
DanglingIntPointer(i, msg) => {
|
DanglingIntPointer(i, msg) => {
|
||||||
write!(f, "{msg}{:#x} is not a valid pointer", i)
|
write!(f, "{msg}{i:#x} is not a valid pointer")
|
||||||
}
|
}
|
||||||
AlignmentCheckFailed { required, has } => write!(
|
AlignmentCheckFailed { required, has } => write!(
|
||||||
f,
|
f,
|
||||||
|
|
|
@ -466,7 +466,7 @@ impl<'tcx> TyCtxt<'tcx> {
|
||||||
return alloc_id;
|
return alloc_id;
|
||||||
}
|
}
|
||||||
let id = alloc_map.reserve();
|
let id = alloc_map.reserve();
|
||||||
debug!("creating alloc {:?} with id {:?}", alloc, id);
|
debug!("creating alloc {alloc:?} with id {id:?}");
|
||||||
alloc_map.alloc_map.insert(id, alloc.clone());
|
alloc_map.alloc_map.insert(id, alloc.clone());
|
||||||
alloc_map.dedup.insert(alloc, id);
|
alloc_map.dedup.insert(alloc, id);
|
||||||
id
|
id
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue