Skip to content

Commit fe8d11b

Browse files
committed
Use an ItemId inside mir::GlobalAsm.
1 parent 5bdc56c commit fe8d11b

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/driver/aot.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,8 @@ fn module_codegen(tcx: TyCtxt<'_>, cgu_name: rustc_span::Symbol) -> ModuleCodege
164164
MonoItem::Static(def_id) => {
165165
crate::constant::codegen_static(&mut cx.constants_cx, def_id)
166166
}
167-
MonoItem::GlobalAsm(hir_id) => {
168-
let item = cx.tcx.hir().expect_item(hir_id);
167+
MonoItem::GlobalAsm(item_id) => {
168+
let item = cx.tcx.hir().item(item_id);
169169
if let rustc_hir::ItemKind::GlobalAsm(rustc_hir::GlobalAsm { asm }) = item.kind {
170170
cx.global_asm.push_str(&*asm.as_str());
171171
cx.global_asm.push_str("\n\n");

src/driver/jit.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,9 @@ pub(super) fn run_jit(tcx: TyCtxt<'_>, codegen_mode: CodegenMode) -> ! {
9393
MonoItem::Static(def_id) => {
9494
crate::constant::codegen_static(&mut cx.constants_cx, def_id);
9595
}
96-
MonoItem::GlobalAsm(hir_id) => {
97-
let item = cx.tcx.hir().expect_item(hir_id);
98-
tcx.sess
99-
.span_fatal(item.span, "Global asm is not supported in JIT mode");
96+
MonoItem::GlobalAsm(item_id) => {
97+
let item = cx.tcx.hir().item(item_id);
98+
tcx.sess.span_fatal(item.span, "Global asm is not supported in JIT mode");
10099
}
101100
}
102101
}

0 commit comments

Comments
 (0)