about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbjorn3 <17426603+bjorn3@users.noreply.github.com>2024-12-12 15:44:49 +0000
committerbjorn3 <17426603+bjorn3@users.noreply.github.com>2025-04-14 09:25:31 +0000
commit14491b0f43404cb6273bea2f1c916bc6b624f7e4 (patch)
tree87b5d7f5fa07385f58260bccc4e6b150029cdaac
parentf836ae4e663b6e8938096b8559e094d18361be55 (diff)
downloadrust-14491b0f43404cb6273bea2f1c916bc6b624f7e4.tar.gz
rust-14491b0f43404cb6273bea2f1c916bc6b624f7e4.zip
Use START_BLOCK in codegen_naked_asm
-rw-r--r--compiler/rustc_codegen_ssa/src/mir/naked_asm.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_codegen_ssa/src/mir/naked_asm.rs b/compiler/rustc_codegen_ssa/src/mir/naked_asm.rs
index 3a6b1f8d4ef..5671f5c5022 100644
--- a/compiler/rustc_codegen_ssa/src/mir/naked_asm.rs
+++ b/compiler/rustc_codegen_ssa/src/mir/naked_asm.rs
@@ -2,7 +2,7 @@ use rustc_abi::{BackendRepr, Float, Integer, Primitive, RegKind};
 use rustc_attr_parsing::InstructionSetAttr;
 use rustc_hir::def_id::DefId;
 use rustc_middle::mir::mono::{Linkage, MonoItem, MonoItemData, Visibility};
-use rustc_middle::mir::{Body, InlineAsmOperand};
+use rustc_middle::mir::{Body, InlineAsmOperand, START_BLOCK};
 use rustc_middle::ty::layout::{FnAbiOf, HasTyCtxt, HasTypingEnv, LayoutOf};
 use rustc_middle::ty::{Instance, Ty, TyCtxt};
 use rustc_middle::{bug, span_bug, ty};
@@ -26,7 +26,7 @@ pub(crate) fn codegen_naked_asm<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
         line_spans,
         targets: _,
         unwind: _,
-    } = mir.basic_blocks.iter().next().unwrap().terminator().kind
+    } = mir.basic_blocks[START_BLOCK].terminator().kind
     else {
         bug!("#[naked] functions should always terminate with an asm! block")
     };