Skip to content

Commit 4eb6754

Browse files
committed
Sync from rust 3e826bb
2 parents ecba16f + 702676b commit 4eb6754

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

src/driver/aot.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ fn module_codegen(
139139
MonoItem::Static(def_id) => {
140140
crate::constant::codegen_static(&mut cx.constants_cx, def_id)
141141
}
142-
MonoItem::GlobalAsm(hir_id) => {
143-
let item = cx.tcx.hir().expect_item(hir_id);
142+
MonoItem::GlobalAsm(item_id) => {
143+
let item = cx.tcx.hir().item(item_id);
144144
if let rustc_hir::ItemKind::GlobalAsm(rustc_hir::GlobalAsm { asm }) = item.kind {
145145
cx.global_asm.push_str(&*asm.as_str());
146146
cx.global_asm.push_str("\n\n");
@@ -433,9 +433,5 @@ fn determine_cgu_reuse<'tcx>(tcx: TyCtxt<'tcx>, cgu: &CodegenUnit<'tcx>) -> CguR
433433
cgu.name()
434434
);
435435

436-
if tcx.dep_graph.try_mark_green(tcx, &dep_node).is_some() {
437-
CguReuse::PreLto
438-
} else {
439-
CguReuse::No
440-
}
436+
if tcx.try_mark_green(&dep_node) { CguReuse::PreLto } else { CguReuse::No }
441437
}

src/driver/jit.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,9 @@ pub(super) fn run_jit(tcx: TyCtxt<'_>, backend_config: BackendConfig) -> ! {
7676
MonoItem::Static(def_id) => {
7777
crate::constant::codegen_static(&mut cx.constants_cx, def_id);
7878
}
79-
MonoItem::GlobalAsm(hir_id) => {
80-
let item = cx.tcx.hir().expect_item(hir_id);
81-
tcx.sess
82-
.span_fatal(item.span, "Global asm is not supported in JIT mode");
79+
MonoItem::GlobalAsm(item_id) => {
80+
let item = cx.tcx.hir().item(item_id);
81+
tcx.sess.span_fatal(item.span, "Global asm is not supported in JIT mode");
8382
}
8483
}
8584
}

0 commit comments

Comments
 (0)