File tree 1 file changed +14
-1
lines changed
compiler/rustc_mir_transform/src
1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -437,6 +437,10 @@ impl<'tcx> Inliner<'tcx> {
437
437
validation : Ok ( ( ) ) ,
438
438
} ;
439
439
440
+ for var_debug_info in callee_body. var_debug_info . iter ( ) {
441
+ checker. visit_var_debug_info ( var_debug_info) ;
442
+ }
443
+
440
444
// Traverse the MIR manually so we can account for the effects of inlining on the CFG.
441
445
let mut work_list = vec ! [ START_BLOCK ] ;
442
446
let mut visited = BitSet :: new_empty ( callee_body. basic_blocks . len ( ) ) ;
@@ -845,7 +849,16 @@ impl<'tcx> Visitor<'tcx> for CostChecker<'_, 'tcx> {
845
849
let parent = Place { local, projection : self . tcx . mk_place_elems ( proj_base) } ;
846
850
let parent_ty = parent. ty ( & self . callee_body . local_decls , self . tcx ) ;
847
851
let check_equal = |this : & mut Self , f_ty| {
848
- if !util:: is_equal_up_to_subtyping ( this. tcx , this. param_env , ty, f_ty) {
852
+ // Fast path if there is nothing to substitute.
853
+ if ty == f_ty {
854
+ return ;
855
+ }
856
+ let ty = this. instance . subst_mir ( this. tcx , ty:: EarlyBinder ( & ty) ) ;
857
+ let f_ty = this. instance . subst_mir ( this. tcx , ty:: EarlyBinder ( & f_ty) ) ;
858
+ if ty == f_ty {
859
+ return ;
860
+ }
861
+ if !util:: is_subtype ( this. tcx , this. param_env , ty, f_ty) {
849
862
trace ! ( ?ty, ?f_ty) ;
850
863
this. validation = Err ( "failed to normalize projection type" ) ;
851
864
return ;
You can’t perform that action at this time.
0 commit comments