@@ -832,7 +832,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
832
832
let ty = moved_place. ty ( self . body , self . infcx . tcx ) . ty ;
833
833
debug ! ( "ty: {:?}, kind: {:?}" , ty, ty. kind( ) ) ;
834
834
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)
836
836
else {
837
837
return ;
838
838
} ;
@@ -1300,7 +1300,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
1300
1300
pub ( crate ) fn implements_clone ( & self , ty : Ty < ' tcx > ) -> bool {
1301
1301
let Some ( clone_trait_def) = self . infcx . tcx . lang_items ( ) . clone_trait ( ) else { return false } ;
1302
1302
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 )
1304
1304
. must_apply_modulo_regions ( )
1305
1305
}
1306
1306
@@ -1433,7 +1433,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
1433
1433
let ocx = ObligationCtxt :: new_with_diagnostics ( self . infcx ) ;
1434
1434
let cause = ObligationCause :: misc ( span, self . mir_def_id ( ) ) ;
1435
1435
1436
- ocx. register_bound ( cause, self . param_env , ty, def_id) ;
1436
+ ocx. register_bound ( cause, self . infcx . param_env , ty, def_id) ;
1437
1437
let errors = ocx. select_all_or_error ( ) ;
1438
1438
1439
1439
// Only emit suggestion if all required predicates are on generic
@@ -1953,7 +1953,8 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
1953
1953
&& let ty:: Ref ( _, inner, _) = rcvr_ty. kind ( )
1954
1954
&& let inner = inner. peel_refs ( )
1955
1955
&& ( 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 )
1957
1958
{
1958
1959
err. span_label (
1959
1960
span,
@@ -1985,7 +1986,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
1985
1986
let obligation = Obligation :: new (
1986
1987
self . infcx . tcx ,
1987
1988
ObligationCause :: dummy ( ) ,
1988
- self . param_env ,
1989
+ self . infcx . param_env ,
1989
1990
trait_ref,
1990
1991
) ;
1991
1992
self . infcx . err_ctxt ( ) . suggest_derive (
@@ -3394,7 +3395,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
3394
3395
if let Some ( iter_trait) = tcx. get_diagnostic_item ( sym:: Iterator )
3395
3396
&& self
3396
3397
. infcx
3397
- . type_implements_trait ( iter_trait, [ return_ty] , self . param_env )
3398
+ . type_implements_trait ( iter_trait, [ return_ty] , self . infcx . param_env )
3398
3399
. must_apply_modulo_regions ( )
3399
3400
{
3400
3401
err. span_suggestion_hidden (
@@ -3833,11 +3834,11 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
3833
3834
if tcx. is_diagnostic_item ( sym:: deref_method, method_did) {
3834
3835
let deref_target =
3835
3836
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)
3837
3838
. transpose ( )
3838
3839
} ) ;
3839
3840
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 ) ;
3841
3842
err. note ( format ! ( "borrow occurs due to deref coercion to `{deref_target_ty}`" ) ) ;
3842
3843
err. span_note ( tcx. def_span ( instance. def_id ( ) ) , "deref defined here" ) ;
3843
3844
}
0 commit comments