Avoid cloning LocalDecls
This commit is contained in:
@@ -607,13 +607,7 @@ impl Inliner<'tcx> {
|
||||
}
|
||||
|
||||
// Insert all of the (mapped) parts of the callee body into the caller.
|
||||
caller_body.local_decls.extend(
|
||||
// FIXME(eddyb) make `Range<Local>` iterable so that we can use
|
||||
// `callee_body.local_decls.drain(callee_body.vars_and_temps())`
|
||||
callee_body
|
||||
.vars_and_temps_iter()
|
||||
.map(|local| callee_body.local_decls[local].clone()),
|
||||
);
|
||||
caller_body.local_decls.extend(callee_body.drain_vars_and_temps());
|
||||
caller_body.source_scopes.extend(&mut callee_body.source_scopes.drain(..));
|
||||
caller_body.var_debug_info.append(&mut callee_body.var_debug_info);
|
||||
caller_body.basic_blocks_mut().extend(callee_body.basic_blocks_mut().drain(..));
|
||||
|
||||
Reference in New Issue
Block a user