File tree Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -310,15 +310,19 @@ impl<'tcx> Instance<'tcx> {
310310 substs : SubstsRef < ' tcx > ,
311311 ) -> Option < Instance < ' tcx > > {
312312 debug ! ( "resolve(def_id={:?}, substs={:?})" , def_id, substs) ;
313- if tcx. codegen_fn_attrs ( def_id) . flags . contains ( CodegenFnAttrFlags :: TRACK_CALLER ) {
314- debug ! ( " => fn pointer created for function with #[track_caller]" ) ;
315- Some ( Instance {
316- def : InstanceDef :: ReifyShim ( def_id) ,
317- substs,
318- } )
319- } else {
320- Instance :: resolve ( tcx, param_env, def_id, substs)
321- }
313+ Instance :: resolve ( tcx, param_env, def_id, substs) . map ( |resolved| {
314+ let resolved_def = resolved. def_id ( ) ;
315+ let codegen_attrs = tcx. codegen_fn_attrs ( resolved_def) ;
316+ if codegen_attrs. flags . contains ( CodegenFnAttrFlags :: TRACK_CALLER ) {
317+ debug ! ( " => fn pointer created for function with #[track_caller]" ) ;
318+ Instance {
319+ def : InstanceDef :: ReifyShim ( resolved_def) ,
320+ substs,
321+ }
322+ } else {
323+ resolved
324+ }
325+ } )
322326 }
323327
324328 pub fn resolve_for_vtable (
You can’t perform that action at this time.
0 commit comments