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