File tree Expand file tree Collapse file tree 2 files changed +8
-9
lines changed Expand file tree Collapse file tree 2 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,10 @@ pub(crate) fn codegen_fn<'tcx>(
12
12
) {
13
13
let tcx = cx. tcx ;
14
14
15
+ let _inst_guard =
16
+ crate :: PrintOnPanic ( || format ! ( "{:?} {}" , instance, tcx. symbol_name( instance) . name) ) ;
17
+ debug_assert ! ( !instance. substs. needs_infer( ) ) ;
18
+
15
19
let mir = tcx. instance_mir ( instance. def ) ;
16
20
17
21
// Declare function
Original file line number Diff line number Diff line change @@ -68,20 +68,15 @@ fn codegen_mono_item<'tcx, M: Module>(
68
68
mono_item : MonoItem < ' tcx > ,
69
69
linkage : Linkage ,
70
70
) {
71
- let tcx = cx. tcx ;
72
71
match mono_item {
73
72
MonoItem :: Fn ( inst) => {
74
- let _inst_guard =
75
- crate :: PrintOnPanic ( || format ! ( "{:?} {}" , inst, tcx. symbol_name( inst) . name) ) ;
76
- debug_assert ! ( !inst. substs. needs_infer( ) ) ;
77
- tcx. sess
73
+ cx. tcx
74
+ . sess
78
75
. time ( "codegen fn" , || crate :: base:: codegen_fn ( cx, inst, linkage) ) ;
79
76
}
80
- MonoItem :: Static ( def_id) => {
81
- crate :: constant:: codegen_static ( & mut cx. constants_cx , def_id) ;
82
- }
77
+ MonoItem :: Static ( def_id) => crate :: constant:: codegen_static ( & mut cx. constants_cx , def_id) ,
83
78
MonoItem :: GlobalAsm ( hir_id) => {
84
- let item = tcx. hir ( ) . expect_item ( hir_id) ;
79
+ let item = cx . tcx . hir ( ) . expect_item ( hir_id) ;
85
80
if let rustc_hir:: ItemKind :: GlobalAsm ( rustc_hir:: GlobalAsm { asm } ) = item. kind {
86
81
cx. global_asm . push_str ( & * asm. as_str ( ) ) ;
87
82
cx. global_asm . push_str ( "\n \n " ) ;
You can’t perform that action at this time.
0 commit comments