This repository was archived by the owner on May 28, 2025. It is now read-only.
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>(
1212) {
1313 let tcx = cx. tcx ;
1414
15+ let _inst_guard =
16+ crate :: PrintOnPanic ( || format ! ( "{:?} {}" , instance, tcx. symbol_name( instance) . name) ) ;
17+ debug_assert ! ( !instance. substs. needs_infer( ) ) ;
18+
1519 let mir = tcx. instance_mir ( instance. def ) ;
1620
1721 // Declare function
Original file line number Diff line number Diff line change @@ -68,20 +68,15 @@ fn codegen_mono_item<'tcx, M: Module>(
6868 mono_item : MonoItem < ' tcx > ,
6969 linkage : Linkage ,
7070) {
71- let tcx = cx. tcx ;
7271 match mono_item {
7372 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
7875 . time ( "codegen fn" , || crate :: base:: codegen_fn ( cx, inst, linkage) ) ;
7976 }
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) ,
8378 MonoItem :: GlobalAsm ( hir_id) => {
84- let item = tcx. hir ( ) . expect_item ( hir_id) ;
79+ let item = cx . tcx . hir ( ) . expect_item ( hir_id) ;
8580 if let rustc_hir:: ItemKind :: GlobalAsm ( rustc_hir:: GlobalAsm { asm } ) = item. kind {
8681 cx. global_asm . push_str ( & * asm. as_str ( ) ) ;
8782 cx. global_asm . push_str ( "\n \n " ) ;
You can’t perform that action at this time.
0 commit comments