about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbjorn3 <bjorn3@users.noreply.github.com>2021-02-21 17:02:04 +0100
committerbjorn3 <bjorn3@users.noreply.github.com>2021-02-21 17:02:04 +0100
commit4eb67547498dd338800a4ebefd0a0e907752d04b (patch)
treed937981df38508009328f608bc967d4a9110b570
parentecba16f29616265b81b415921f69e5b104085123 (diff)
parent702676bfff241bc1b8766f11f6dd42b356ebc071 (diff)
downloadrust-4eb67547498dd338800a4ebefd0a0e907752d04b.tar.gz
rust-4eb67547498dd338800a4ebefd0a0e907752d04b.zip
Sync from rust 3e826bb11228508fbe749e594038d6727208aa94
-rw-r--r--src/driver/aot.rs10
-rw-r--r--src/driver/jit.rs7
2 files changed, 6 insertions, 11 deletions
diff --git a/src/driver/aot.rs b/src/driver/aot.rs
index 8085a04184b..a7fcbb2f1e4 100644
--- a/src/driver/aot.rs
+++ b/src/driver/aot.rs
@@ -139,8 +139,8 @@ fn module_codegen(
             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");
@@ -433,9 +433,5 @@ fn determine_cgu_reuse<'tcx>(tcx: TyCtxt<'tcx>, cgu: &CodegenUnit<'tcx>) -> CguR
         cgu.name()
     );
 
-    if tcx.dep_graph.try_mark_green(tcx, &dep_node).is_some() {
-        CguReuse::PreLto
-    } else {
-        CguReuse::No
-    }
+    if tcx.try_mark_green(&dep_node) { CguReuse::PreLto } else { CguReuse::No }
 }
diff --git a/src/driver/jit.rs b/src/driver/jit.rs
index 1640c622b91..7857e837143 100644
--- a/src/driver/jit.rs
+++ b/src/driver/jit.rs
@@ -76,10 +76,9 @@ pub(super) fn run_jit(tcx: TyCtxt<'_>, backend_config: BackendConfig) -> ! {
                 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");
                 }
             }
         }