diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2021-01-30 19:18:48 +0100 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2021-02-15 19:24:58 +0100 |
| commit | fe8d11bb99da0c4869f985137f40ab337a955890 (patch) | |
| tree | e90c2b1f85775fba0c9d90347ebfd1390c542463 | |
| parent | 5bdc56c00cfc5d675e628e346e493bd619aed46f (diff) | |
| download | rust-fe8d11bb99da0c4869f985137f40ab337a955890.tar.gz rust-fe8d11bb99da0c4869f985137f40ab337a955890.zip | |
Use an ItemId inside mir::GlobalAsm.
| -rw-r--r-- | src/driver/aot.rs | 4 | ||||
| -rw-r--r-- | src/driver/jit.rs | 7 |
2 files changed, 5 insertions, 6 deletions
diff --git a/src/driver/aot.rs b/src/driver/aot.rs index df89883f0bb..c9e503a43b9 100644 --- a/src/driver/aot.rs +++ b/src/driver/aot.rs @@ -164,8 +164,8 @@ fn module_codegen(tcx: TyCtxt<'_>, cgu_name: rustc_span::Symbol) -> ModuleCodege MonoItem::Static(def_id) => { crate::constant::codegen_static(&mut cx.constants_cx, def_id) } - MonoItem::GlobalAsm(hir_id) => { - let item = cx.tcx.hir().expect_item(hir_id); + MonoItem::GlobalAsm(item_id) => { + let item = cx.tcx.hir().item(item_id); if let rustc_hir::ItemKind::GlobalAsm(rustc_hir::GlobalAsm { asm }) = item.kind { cx.global_asm.push_str(&*asm.as_str()); cx.global_asm.push_str("\n\n"); diff --git a/src/driver/jit.rs b/src/driver/jit.rs index 2d14ff2c022..f784d8d27cc 100644 --- a/src/driver/jit.rs +++ b/src/driver/jit.rs @@ -93,10 +93,9 @@ pub(super) fn run_jit(tcx: TyCtxt<'_>, codegen_mode: CodegenMode) -> ! { MonoItem::Static(def_id) => { crate::constant::codegen_static(&mut cx.constants_cx, def_id); } - MonoItem::GlobalAsm(hir_id) => { - let item = cx.tcx.hir().expect_item(hir_id); - tcx.sess - .span_fatal(item.span, "Global asm is not supported in JIT mode"); + MonoItem::GlobalAsm(item_id) => { + let item = cx.tcx.hir().item(item_id); + tcx.sess.span_fatal(item.span, "Global asm is not supported in JIT mode"); } } } |
