cleanup: don't clone types that are Copy

This commit is contained in:
Matthias Krüger
2024-09-29 13:31:30 +02:00
parent 9903b256a2
commit 71cd918dc7
5 changed files with 13 additions and 18 deletions

View File

@@ -185,15 +185,14 @@ impl<'tcx> MutVisitor<'tcx> for LocalReplacer<'tcx> {
&& let Some(local) = place.as_local()
&& local == self.local
{
let const_op = self
let const_op = *self
.operand
.as_ref()
.unwrap_or_else(|| {
bug!("the operand was already stolen");
})
.constant()
.unwrap()
.clone();
.unwrap();
var_debug_info.value = VarDebugInfoContents::Const(const_op);
}
}