@@ -832,7 +832,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
832832 let ty = moved_place. ty ( self . body , self . infcx . tcx ) . ty ;
833833 debug ! ( "ty: {:?}, kind: {:?}" , ty, ty. kind( ) ) ;
834834
835- let Some ( assign_value) = self . infcx . err_ctxt ( ) . ty_kind_suggestion ( self . param_env , ty)
835+ let Some ( assign_value) = self . infcx . err_ctxt ( ) . ty_kind_suggestion ( self . infcx . param_env , ty)
836836 else {
837837 return ;
838838 } ;
@@ -1300,7 +1300,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
13001300 pub ( crate ) fn implements_clone ( & self , ty : Ty < ' tcx > ) -> bool {
13011301 let Some ( clone_trait_def) = self . infcx . tcx . lang_items ( ) . clone_trait ( ) else { return false } ;
13021302 self . infcx
1303- . type_implements_trait ( clone_trait_def, [ ty] , self . param_env )
1303+ . type_implements_trait ( clone_trait_def, [ ty] , self . infcx . param_env )
13041304 . must_apply_modulo_regions ( )
13051305 }
13061306
@@ -1433,7 +1433,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
14331433 let ocx = ObligationCtxt :: new_with_diagnostics ( self . infcx ) ;
14341434 let cause = ObligationCause :: misc ( span, self . mir_def_id ( ) ) ;
14351435
1436- ocx. register_bound ( cause, self . param_env , ty, def_id) ;
1436+ ocx. register_bound ( cause, self . infcx . param_env , ty, def_id) ;
14371437 let errors = ocx. select_all_or_error ( ) ;
14381438
14391439 // Only emit suggestion if all required predicates are on generic
@@ -1953,7 +1953,8 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
19531953 && let ty:: Ref ( _, inner, _) = rcvr_ty. kind ( )
19541954 && let inner = inner. peel_refs ( )
19551955 && ( Holds { ty : inner } ) . visit_ty ( local_ty) . is_break ( )
1956- && let None = self . infcx . type_implements_trait_shallow ( clone, inner, self . param_env )
1956+ && let None =
1957+ self . infcx . type_implements_trait_shallow ( clone, inner, self . infcx . param_env )
19571958 {
19581959 err. span_label (
19591960 span,
@@ -1985,7 +1986,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
19851986 let obligation = Obligation :: new (
19861987 self . infcx . tcx ,
19871988 ObligationCause :: dummy ( ) ,
1988- self . param_env ,
1989+ self . infcx . param_env ,
19891990 trait_ref,
19901991 ) ;
19911992 self . infcx . err_ctxt ( ) . suggest_derive (
@@ -3394,7 +3395,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
33943395 if let Some ( iter_trait) = tcx. get_diagnostic_item ( sym:: Iterator )
33953396 && self
33963397 . infcx
3397- . type_implements_trait ( iter_trait, [ return_ty] , self . param_env )
3398+ . type_implements_trait ( iter_trait, [ return_ty] , self . infcx . param_env )
33983399 . must_apply_modulo_regions ( )
33993400 {
34003401 err. span_suggestion_hidden (
@@ -3833,11 +3834,11 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
38333834 if tcx. is_diagnostic_item ( sym:: deref_method, method_did) {
38343835 let deref_target =
38353836 tcx. get_diagnostic_item ( sym:: deref_target) . and_then ( |deref_target| {
3836- Instance :: try_resolve ( tcx, self . param_env , deref_target, method_args)
3837+ Instance :: try_resolve ( tcx, self . infcx . param_env , deref_target, method_args)
38373838 . transpose ( )
38383839 } ) ;
38393840 if let Some ( Ok ( instance) ) = deref_target {
3840- let deref_target_ty = instance. ty ( tcx, self . param_env ) ;
3841+ let deref_target_ty = instance. ty ( tcx, self . infcx . param_env ) ;
38413842 err. note ( format ! ( "borrow occurs due to deref coercion to `{deref_target_ty}`" ) ) ;
38423843 err. span_note ( tcx. def_span ( instance. def_id ( ) ) , "deref defined here" ) ;
38433844 }
0 commit comments