File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed
rustc_next_trait_solver/src/solve
rustc_trait_selection/src Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -208,6 +208,7 @@ where
208208 }
209209 }
210210
211+ // TODO:
211212 if let ty:: CoroutineWitness ( def_id, _) = goal. predicate . self_ty ( ) . kind ( ) {
212213 match ecx. typing_mode ( ) {
213214 TypingMode :: Analysis { stalled_generators, defining_opaque_types : _ } => {
@@ -274,6 +275,22 @@ where
274275 return Err ( NoSolution ) ;
275276 }
276277
278+ // TODO:
279+ if let ty:: CoroutineWitness ( def_id, _) = goal. predicate . self_ty ( ) . kind ( ) {
280+ match ecx. typing_mode ( ) {
281+ TypingMode :: Analysis { stalled_generators, defining_opaque_types : _ } => {
282+ if def_id. as_local ( ) . is_some_and ( |def_id| stalled_generators. contains ( & def_id) )
283+ {
284+ return ecx. forced_ambiguity ( MaybeCause :: Ambiguity ) ;
285+ }
286+ }
287+ TypingMode :: Coherence
288+ | TypingMode :: PostAnalysis
289+ | TypingMode :: Borrowck { defining_opaque_types : _ }
290+ | TypingMode :: PostBorrowckAnalysis { defined_opaque_types : _ } => { }
291+ }
292+ }
293+
277294 ecx. probe_and_evaluate_goal_for_constituent_tys (
278295 CandidateSource :: BuiltinImpl ( BuiltinImplSource :: Misc ) ,
279296 goal,
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ impl<'tcx> InferCtxt<'tcx> {
3434
3535 // FIXME(#132279): This should be removed as it causes us to incorrectly
3636 // handle opaques in their defining scope.
37- if !( param_env, ty) . has_infer ( ) {
37+ if !self . next_trait_solver ( ) && ! ( param_env, ty) . has_infer ( ) {
3838 return self . tcx . type_is_copy_modulo_regions ( self . typing_env ( param_env) , ty) ;
3939 }
4040
You can’t perform that action at this time.
0 commit comments