respond to review

This commit is contained in:
Deadbeef
2025-10-26 19:57:05 +00:00
parent 744c670812
commit 042018df2d
3 changed files with 18 additions and 13 deletions

View File

@@ -368,7 +368,11 @@ fn evaluate_host_effect_for_copy_clone_goal<'tcx>(
// only when `coroutine_clone` is enabled and the coroutine is movable
// impl Copy/Clone for Coroutine where T: Copy/Clone forall T in (upvars, witnesses)
ty::Coroutine(def_id, args) => match tcx.coroutine_movability(def_id) {
ty::Coroutine(def_id, args) => {
if selcx.should_stall_coroutine(def_id) {
return Err(EvaluationFailure::Ambiguous);
}
match tcx.coroutine_movability(def_id) {
ty::Movability::Static => Err(EvaluationFailure::NoSolution),
ty::Movability::Movable => {
if tcx.features().coroutine_clone() {
@@ -380,7 +384,8 @@ fn evaluate_host_effect_for_copy_clone_goal<'tcx>(
Err(EvaluationFailure::NoSolution)
}
}
},
}
}
ty::UnsafeBinder(_) => Err(EvaluationFailure::NoSolution),

View File

@@ -2877,7 +2877,7 @@ impl<'tcx> SelectionContext<'_, 'tcx> {
obligations
}
fn should_stall_coroutine(&self, def_id: DefId) -> bool {
pub(super) fn should_stall_coroutine(&self, def_id: DefId) -> bool {
match self.infcx.typing_mode() {
TypingMode::Analysis { defining_opaque_types_and_generators: stalled_generators } => {
def_id.as_local().is_some_and(|def_id| stalled_generators.contains(&def_id))

View File

@@ -121,7 +121,7 @@ impl<I: Interner> ty::Binder<I, TraitRef<I>> {
}
pub fn to_host_effect_clause(self, cx: I, constness: BoundConstness) -> I::Clause {
self.map_bound(|trait_ref: TraitRef<I>| {
self.map_bound(|trait_ref| {
ty::ClauseKind::HostEffect(HostEffectPredicate { trait_ref, constness })
})
.upcast(cx)