about summary refs log tree commit diff
path: root/compiler/rustc_codegen_ssa/src
diff options
context:
space:
mode:
authordianqk <dianqk@dianqk.net>2025-06-30 19:23:20 +0800
committerGitHub <noreply@github.com>2025-06-30 19:23:20 +0800
commitab633af710a50722229a8776cefdd30afe3aa7ca (patch)
tree3631944a220542d72cccd4391566464e3be1c300 /compiler/rustc_codegen_ssa/src
parent043fc5b230ee708f253e2eefead300c105e4bef5 (diff)
parent24e553e6bcfa329b04b93c0978e00b492224a255 (diff)
downloadrust-ab633af710a50722229a8776cefdd30afe3aa7ca.tar.gz
rust-ab633af710a50722229a8776cefdd30afe3aa7ca.zip
Rollup merge of #143190 - dianqk:new-method, r=oli-obk
Use the `new` method for `BasicBlockData` and `Statement`

This is the NFC part of rust-lang/rust#142771. I split it to make it easier to review for rust-lang/rust#142771. Even without rust-lang/rust#142771, I think this change is worthwhile.
Diffstat (limited to 'compiler/rustc_codegen_ssa/src')
-rw-r--r--compiler/rustc_codegen_ssa/src/mir/mod.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_codegen_ssa/src/mir/mod.rs b/compiler/rustc_codegen_ssa/src/mir/mod.rs
index 66c4af4c935..10b44a1faf0 100644
--- a/compiler/rustc_codegen_ssa/src/mir/mod.rs
+++ b/compiler/rustc_codegen_ssa/src/mir/mod.rs
@@ -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 };
         }