diff options
| author | Michael Goulet <michael@errs.io> | 2025-04-18 17:26:30 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2025-04-22 17:05:15 +0000 |
| commit | 7c1661f9457825df6e6bbf4869be3cad59b608a9 (patch) | |
| tree | 5a15b4aebc30044eb0319df75f76f53766563e48 | |
| parent | 1727badf77704a5c44c40a30df833702ed309324 (diff) | |
| download | rust-7c1661f9457825df6e6bbf4869be3cad59b608a9.tar.gz rust-7c1661f9457825df6e6bbf4869be3cad59b608a9.zip | |
Consider Copy/Clone too
| -rw-r--r-- | compiler/rustc_next_trait_solver/src/solve/trait_goals.rs | 17 | ||||
| -rw-r--r-- | compiler/rustc_trait_selection/src/infer.rs | 2 |
2 files changed, 18 insertions, 1 deletions
diff --git a/compiler/rustc_next_trait_solver/src/solve/trait_goals.rs b/compiler/rustc_next_trait_solver/src/solve/trait_goals.rs index 38c4d0205cd..13132d60dfa 100644 --- a/compiler/rustc_next_trait_solver/src/solve/trait_goals.rs +++ b/compiler/rustc_next_trait_solver/src/solve/trait_goals.rs @@ -208,6 +208,7 @@ where } } + // TODO: if let ty::CoroutineWitness(def_id, _) = goal.predicate.self_ty().kind() { match ecx.typing_mode() { TypingMode::Analysis { stalled_generators, defining_opaque_types: _ } => { @@ -274,6 +275,22 @@ where return Err(NoSolution); } + // TODO: + if let ty::CoroutineWitness(def_id, _) = goal.predicate.self_ty().kind() { + match ecx.typing_mode() { + TypingMode::Analysis { stalled_generators, defining_opaque_types: _ } => { + if def_id.as_local().is_some_and(|def_id| stalled_generators.contains(&def_id)) + { + return ecx.forced_ambiguity(MaybeCause::Ambiguity); + } + } + TypingMode::Coherence + | TypingMode::PostAnalysis + | TypingMode::Borrowck { defining_opaque_types: _ } + | TypingMode::PostBorrowckAnalysis { defined_opaque_types: _ } => {} + } + } + ecx.probe_and_evaluate_goal_for_constituent_tys( CandidateSource::BuiltinImpl(BuiltinImplSource::Misc), goal, diff --git a/compiler/rustc_trait_selection/src/infer.rs b/compiler/rustc_trait_selection/src/infer.rs index 84ac229b743..0dab3adadb0 100644 --- a/compiler/rustc_trait_selection/src/infer.rs +++ b/compiler/rustc_trait_selection/src/infer.rs @@ -34,7 +34,7 @@ impl<'tcx> InferCtxt<'tcx> { // FIXME(#132279): This should be removed as it causes us to incorrectly // handle opaques in their defining scope. - if !(param_env, ty).has_infer() { + if !self.next_trait_solver() && !(param_env, ty).has_infer() { return self.tcx.type_is_copy_modulo_regions(self.typing_env(param_env), ty); } |
