未验证 提交 0832d1d0 编写于 作者: R Ralf Jung 提交者: GitHub

more use of format! variable capture

Co-authored-by: NJoe ST <joe@fbstj.net>
上级 d31cbb51
......@@ -306,9 +306,7 @@ pub fn deallocate_ptr(
}
if alloc_kind != kind {
throw_ub_format!(
"deallocating {alloc_id:?}, which is {} memory, using {} deallocation operation",
alloc_kind,
kind
"deallocating {alloc_id:?}, which is {alloc_kind} memory, using {kind} deallocation operation"
);
}
if let Some((size, align)) = old_size_and_align {
......
......@@ -357,7 +357,7 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{msg}null pointer is not a valid pointer")
}
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!(
f,
......
......@@ -466,7 +466,7 @@ fn reserve_and_set_dedup(self, alloc: GlobalAlloc<'tcx>) -> AllocId {
return alloc_id;
}
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.dedup.insert(alloc, id);
id
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册