respond to review
This commit is contained in:
@@ -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),
|
||||
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user