File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
compiler/rustc_mir_transform/src Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -440,6 +440,10 @@ impl<'tcx> Inliner<'tcx> {
440440 validation : Ok ( ( ) ) ,
441441 } ;
442442
443+ for var_debug_info in callee_body. var_debug_info . iter ( ) {
444+ checker. visit_var_debug_info ( var_debug_info) ;
445+ }
446+
443447 // Traverse the MIR manually so we can account for the effects of inlining on the CFG.
444448 let mut work_list = vec ! [ START_BLOCK ] ;
445449 let mut visited = BitSet :: new_empty ( callee_body. basic_blocks . len ( ) ) ;
@@ -847,7 +851,16 @@ impl<'tcx> Visitor<'tcx> for CostChecker<'_, 'tcx> {
847851 if let ProjectionElem :: Field ( f, ty) = elem {
848852 let parent_ty = place_ref. ty ( & self . callee_body . local_decls , self . tcx ) ;
849853 let check_equal = |this : & mut Self , f_ty| {
850- if !util:: is_equal_up_to_subtyping ( this. tcx , this. param_env , ty, f_ty) {
854+ // Fast path if there is nothing to substitute.
855+ if ty == f_ty {
856+ return ;
857+ }
858+ let ty = this. instance . subst_mir ( this. tcx , ty:: EarlyBinder :: bind ( & ty) ) ;
859+ let f_ty = this. instance . subst_mir ( this. tcx , ty:: EarlyBinder :: bind ( & f_ty) ) ;
860+ if ty == f_ty {
861+ return ;
862+ }
863+ if !util:: is_subtype ( this. tcx , this. param_env , ty, f_ty) {
851864 trace ! ( ?ty, ?f_ty) ;
852865 this. validation = Err ( "failed to normalize projection type" ) ;
853866 return ;
You can’t perform that action at this time.
0 commit comments