@@ -44,6 +44,7 @@ use hir_def::{
4444 resolver:: { HasResolver , ResolveValueResult , Resolver , TypeNs , ValueNs } ,
4545 signatures:: { ConstSignature , EnumSignature , FunctionSignature , StaticSignature } ,
4646 type_ref:: { ConstRef , LifetimeRefId , TypeRef , TypeRefId } ,
47+ unstable_features:: UnstableFeatures ,
4748} ;
4849use hir_expand:: { mod_path:: ModPath , name:: Name } ;
4950use indexmap:: IndexSet ;
@@ -78,7 +79,7 @@ use crate::{
7879 lower:: {
7980 ImplTraitIdx , ImplTraitLoweringMode , LifetimeElisionKind , diagnostics:: TyLoweringDiagnostic ,
8081 } ,
81- method_resolution:: { CandidateId , MethodResolutionUnstableFeatures } ,
82+ method_resolution:: CandidateId ,
8283 next_solver:: {
8384 AliasTy , Const , DbInterner , ErrorGuaranteed , GenericArg , GenericArgs , Region ,
8485 StoredGenericArgs , StoredTy , StoredTys , Ty , TyKind , Tys ,
@@ -1112,11 +1113,11 @@ pub(crate) struct InferenceContext<'body, 'db> {
11121113 /// and resolve the path via its methods. This will ensure proper error reporting.
11131114 pub ( crate ) resolver : Resolver < ' db > ,
11141115 target_features : OnceCell < ( TargetFeatures < ' db > , TargetFeatureIsSafeInTarget ) > ,
1115- pub ( crate ) unstable_features : MethodResolutionUnstableFeatures ,
11161116 pub ( crate ) edition : Edition ,
11171117 pub ( crate ) generic_def : GenericDefId ,
11181118 pub ( crate ) table : unify:: InferenceTable < ' db > ,
11191119 pub ( crate ) lang_items : & ' db LangItems ,
1120+ pub ( crate ) features : & ' db UnstableFeatures ,
11201121 /// The traits in scope, disregarding block modules. This is used for caching purposes.
11211122 traits_in_scope : FxHashSet < TraitId > ,
11221123 pub ( crate ) result : InferenceResult ,
@@ -1218,10 +1219,8 @@ impl<'body, 'db> InferenceContext<'body, 'db> {
12181219 return_ty : types. types . error , // set in collect_* calls
12191220 types,
12201221 target_features : OnceCell :: new ( ) ,
1221- unstable_features : MethodResolutionUnstableFeatures :: from_def_map (
1222- resolver. top_level_def_map ( ) ,
1223- ) ,
12241222 lang_items : table. interner ( ) . lang_items ( ) ,
1223+ features : resolver. top_level_def_map ( ) . features ( ) ,
12251224 edition : resolver. krate ( ) . data ( db) . edition ,
12261225 table,
12271226 tuple_field_accesses_rev : Default :: default ( ) ,
@@ -2317,7 +2316,7 @@ impl<'body, 'db> InferenceContext<'body, 'db> {
23172316 }
23182317
23192318 fn has_new_range_feature ( & self ) -> bool {
2320- self . resolver . top_level_def_map ( ) . is_unstable_feature_enabled ( & sym :: new_range)
2319+ self . features . new_range
23212320 }
23222321
23232322 fn resolve_range ( & self ) -> Option < AdtId > {
0 commit comments