@@ -147,27 +147,41 @@ where
147147 None => self . evaluate_added_goals_and_make_canonical_response ( Certainty :: AMBIGUOUS ) ,
148148 }
149149 }
150-
151- fn compute_unstable_feature_goal ( & mut self , param_env : <I as Interner >:: ParamEnv , symbol : <I as Interner >:: Symbol ) -> QueryResult < I > {
152- // Iterate through all goals in param_env to find the one that has the same
153- // symbol as the one in the goal
150+
151+ fn compute_unstable_feature_goal (
152+ & mut self ,
153+ param_env : <I as Interner >:: ParamEnv ,
154+ symbol : <I as Interner >:: Symbol ,
155+ ) -> QueryResult < I > {
156+ // Iterate through all goals in param_env to find the one that has the same symbol.
154157 for pred in param_env. caller_bounds ( ) . iter ( ) {
155158 match pred. kind ( ) . skip_binder ( ) {
156159 ty:: ClauseKind :: UnstableFeature ( sym) => {
157160 if sym == symbol {
158- return self . evaluate_added_goals_and_make_canonical_response ( Certainty :: Yes ) ;
161+ return self
162+ . evaluate_added_goals_and_make_canonical_response ( Certainty :: Yes ) ;
159163 }
160164 }
161165 _ => { } // don't care
162166 }
163167 }
164168
165169 if self . cx ( ) . features ( ) . impl_stability ( ) {
166- return self . evaluate_added_goals_and_make_canonical_response ( Certainty :: Maybe ( MaybeCause :: Ambiguity ) ) ;
170+ return self . evaluate_added_goals_and_make_canonical_response ( Certainty :: Maybe (
171+ MaybeCause :: Ambiguity ,
172+ ) ) ;
167173 } else {
168- todo ! ( ) ;
174+ // Check if feature is enabled at crate level with #[feature(..)] or if we are currently in codegen.
175+ if self . cx ( ) . features ( ) . enabled ( symbol)
176+ || ( self . typing_mode ( ) == TypingMode :: PostAnalysis )
177+ {
178+ return self . evaluate_added_goals_and_make_canonical_response ( Certainty :: Yes ) ;
179+ } else {
180+ return self . evaluate_added_goals_and_make_canonical_response ( Certainty :: Maybe (
181+ MaybeCause :: Ambiguity ,
182+ ) ) ;
183+ }
169184 }
170-
171185 }
172186
173187 #[ instrument( level = "trace" , skip( self ) ) ]
0 commit comments