Skip to content

Commit 2d8656f

Browse files
Meow copy query cycle
1 parent 279a2a3 commit 2d8656f

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

compiler/rustc_next_trait_solver/src/solve/trait_goals.rs

+16
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,22 @@ where
274274
return Err(NoSolution);
275275
}
276276

277+
// TODO:
278+
if let ty::CoroutineWitness(def_id, _) = goal.predicate.self_ty().kind() {
279+
match ecx.typing_mode() {
280+
TypingMode::Analysis { stalled_generators, defining_opaque_types: _ } => {
281+
if def_id.as_local().is_some_and(|def_id| stalled_generators.contains(&def_id))
282+
{
283+
return ecx.forced_ambiguity(MaybeCause::Ambiguity);
284+
}
285+
}
286+
TypingMode::Coherence
287+
| TypingMode::PostAnalysis
288+
| TypingMode::Borrowck { defining_opaque_types: _ }
289+
| TypingMode::PostBorrowckAnalysis { defined_opaque_types: _ } => {}
290+
}
291+
}
292+
277293
ecx.probe_and_evaluate_goal_for_constituent_tys(
278294
CandidateSource::BuiltinImpl(BuiltinImplSource::Misc),
279295
goal,

compiler/rustc_trait_selection/src/infer.rs

+1-1
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)