@@ -920,8 +920,8 @@ impl<'a, 'db> InferenceContext<'a, 'db> {
920920 self . result . closures_data . insert ( closure_def_id, closure_data) ;
921921 }
922922
923- fn normalize_capture_place ( & self , span : Span , place : Place ) -> Place {
924- let mut place = self . infcx ( ) . resolve_vars_if_possible ( place) ;
923+ fn normalize_capture_place ( & mut self , span : Span , place : Place ) -> Place {
924+ let place = self . infcx ( ) . resolve_vars_if_possible ( place) ;
925925
926926 // In the new solver, types in HIR `Place`s can contain unnormalized aliases,
927927 // which can ICE later (e.g. when projecting fields for diagnostics).
@@ -945,11 +945,8 @@ impl<'a, 'db> InferenceContext<'a, 'db> {
945945 }
946946 normalized
947947 }
948- Err ( _errors) => {
949- place. base_ty = self . types . types . error . store ( ) ;
950- for proj in & mut place. projections {
951- proj. ty = self . types . types . error . store ( ) ;
952- }
948+ Err ( errors) => {
949+ self . table . trait_errors . extend ( errors) ;
953950 place
954951 }
955952 }
@@ -1002,7 +999,7 @@ impl<'a, 'db> InferenceContext<'a, 'db> {
1002999 }
10031000 }
10041001
1005- fn place_for_root_variable ( & self , closure_def_id : ExprId , var_hir_id : BindingId ) -> Place {
1002+ fn place_for_root_variable ( & mut self , closure_def_id : ExprId , var_hir_id : BindingId ) -> Place {
10061003 let place = Place {
10071004 base_ty : self . result . binding_ty ( var_hir_id) . store ( ) ,
10081005 base : PlaceBase :: Upvar { closure : closure_def_id, var_id : var_hir_id } ,
0 commit comments