mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-01 15:50:05 +03:00
mir: Add a new method to statement
Avoid introducing a large number of changes when adding optional initialization fields.
This commit is contained in:
@@ -354,15 +354,15 @@ fn optimize_use_clone<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
|
||||
let destination_block = target.unwrap();
|
||||
|
||||
bb.statements.push(mir::Statement {
|
||||
source_info: bb.terminator().source_info,
|
||||
kind: mir::StatementKind::Assign(Box::new((
|
||||
bb.statements.push(mir::Statement::new(
|
||||
bb.terminator().source_info,
|
||||
mir::StatementKind::Assign(Box::new((
|
||||
*destination,
|
||||
mir::Rvalue::Use(mir::Operand::Copy(
|
||||
arg_place.project_deeper(&[mir::ProjectionElem::Deref], tcx),
|
||||
)),
|
||||
))),
|
||||
});
|
||||
));
|
||||
|
||||
bb.terminator_mut().kind = mir::TerminatorKind::Goto { target: destination_block };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user