mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
Consider Copy/Clone too
This commit is contained in:
parent
1727badf77
commit
7c1661f945
@ -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,
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user