@@ -29,8 +29,8 @@ use crate::{
29
29
db:: HirDatabase ,
30
30
fold_generic_args, fold_tys_and_consts,
31
31
next_solver:: {
32
- self , ClauseKind , DbInterner , ErrorGuaranteed , ParamEnv , Predicate , PredicateKind ,
33
- SolverDefIds , Term , TraitRef ,
32
+ self , ClauseKind , DbInterner , ErrorGuaranteed , Predicate , PredicateKind , SolverDefIds ,
33
+ Term , TraitRef ,
34
34
fulfill:: FulfillmentCtxt ,
35
35
infer:: {
36
36
DbInternerInferExt , InferCtxt , InferOk ,
@@ -213,7 +213,6 @@ pub(crate) struct InferenceTable<'db> {
213
213
pub ( crate ) db : & ' db dyn HirDatabase ,
214
214
pub ( crate ) interner : DbInterner < ' db > ,
215
215
pub ( crate ) trait_env : Arc < TraitEnvironment < ' db > > ,
216
- pub ( crate ) param_env : ParamEnv < ' db > ,
217
216
pub ( crate ) tait_coercion_table : Option < FxHashMap < OpaqueTyId , Ty > > ,
218
217
pub ( crate ) infer_ctxt : InferCtxt < ' db > ,
219
218
diverging_tys : FxHashSet < Ty > ,
@@ -235,7 +234,6 @@ impl<'db> InferenceTable<'db> {
235
234
InferenceTable {
236
235
db,
237
236
interner,
238
- param_env : trait_env. env . to_nextsolver ( interner) ,
239
237
trait_env,
240
238
tait_coercion_table : None ,
241
239
fulfillment_cx : FulfillmentCtxt :: new ( & infer_ctxt) ,
@@ -426,7 +424,7 @@ impl<'db> InferenceTable<'db> {
426
424
{
427
425
let ty = self . resolve_vars_with_obligations ( ty) ;
428
426
self . infer_ctxt
429
- . at ( & ObligationCause :: new ( ) , self . param_env )
427
+ . at ( & ObligationCause :: new ( ) , self . trait_env . env )
430
428
. deeply_normalize ( ty. clone ( ) )
431
429
. unwrap_or ( ty)
432
430
}
@@ -741,7 +739,7 @@ impl<'db> InferenceTable<'db> {
741
739
) -> InferResult < ' db , ( ) > {
742
740
let variance = rustc_type_ir:: Variance :: Invariant ;
743
741
let span = crate :: next_solver:: Span :: dummy ( ) ;
744
- match self . infer_ctxt . relate ( self . param_env , lhs, variance, rhs, span) {
742
+ match self . infer_ctxt . relate ( self . trait_env . env , lhs, variance, rhs, span) {
745
743
Ok ( goals) => Ok ( crate :: infer:: InferOk { goals, value : ( ) } ) ,
746
744
Err ( _) => Err ( TypeError ) ,
747
745
}
@@ -798,7 +796,7 @@ impl<'db> InferenceTable<'db> {
798
796
799
797
fn structurally_normalize_term ( & mut self , term : Term < ' db > ) -> Term < ' db > {
800
798
self . infer_ctxt
801
- . at ( & ObligationCause :: new ( ) , self . param_env )
799
+ . at ( & ObligationCause :: new ( ) , self . trait_env . env )
802
800
. structurally_normalize_term ( term, & mut self . fulfillment_cx )
803
801
. unwrap_or ( term)
804
802
}
@@ -818,7 +816,7 @@ impl<'db> InferenceTable<'db> {
818
816
// in a reentrant borrow, causing an ICE.
819
817
let result = self
820
818
. infer_ctxt
821
- . at ( & ObligationCause :: misc ( ) , self . param_env )
819
+ . at ( & ObligationCause :: misc ( ) , self . trait_env . env )
822
820
. structurally_normalize_ty ( ty, & mut self . fulfillment_cx ) ;
823
821
match result {
824
822
Ok ( normalized_ty) => normalized_ty,
@@ -874,14 +872,14 @@ impl<'db> InferenceTable<'db> {
874
872
/// choice (during e.g. method resolution or deref).
875
873
#[ tracing:: instrument( level = "debug" , skip( self ) ) ]
876
874
pub ( crate ) fn try_obligation ( & mut self , predicate : Predicate < ' db > ) -> NextTraitSolveResult {
877
- let goal = next_solver:: Goal { param_env : self . param_env , predicate } ;
875
+ let goal = next_solver:: Goal { param_env : self . trait_env . env , predicate } ;
878
876
let canonicalized = self . canonicalize ( goal) ;
879
877
880
878
next_trait_solve_canonical_in_ctxt ( & self . infer_ctxt , canonicalized)
881
879
}
882
880
883
881
pub ( crate ) fn register_obligation ( & mut self , predicate : Predicate < ' db > ) {
884
- let goal = next_solver:: Goal { param_env : self . param_env , predicate } ;
882
+ let goal = next_solver:: Goal { param_env : self . trait_env . env , predicate } ;
885
883
self . register_obligation_in_env ( goal)
886
884
}
887
885
0 commit comments