File tree Expand file tree Collapse file tree 2 files changed +6
-11
lines changed Expand file tree Collapse file tree 2 files changed +6
-11
lines changed Original file line number Diff line number Diff line change @@ -139,8 +139,8 @@ fn module_codegen(
139
139
MonoItem :: Static ( def_id) => {
140
140
crate :: constant:: codegen_static ( & mut cx. constants_cx , def_id)
141
141
}
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 ) ;
144
144
if let rustc_hir:: ItemKind :: GlobalAsm ( rustc_hir:: GlobalAsm { asm } ) = item. kind {
145
145
cx. global_asm . push_str ( & * asm. as_str ( ) ) ;
146
146
cx. global_asm . push_str ( "\n \n " ) ;
@@ -433,9 +433,5 @@ fn determine_cgu_reuse<'tcx>(tcx: TyCtxt<'tcx>, cgu: &CodegenUnit<'tcx>) -> CguR
433
433
cgu. name( )
434
434
) ;
435
435
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 }
441
437
}
Original file line number Diff line number Diff line change @@ -76,10 +76,9 @@ pub(super) fn run_jit(tcx: TyCtxt<'_>, backend_config: BackendConfig) -> ! {
76
76
MonoItem :: Static ( def_id) => {
77
77
crate :: constant:: codegen_static ( & mut cx. constants_cx , def_id) ;
78
78
}
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" ) ;
83
82
}
84
83
}
85
84
}
You can’t perform that action at this time.
0 commit comments