Remove movability from TyKind::Coroutine
This commit is contained in:
@@ -246,7 +246,7 @@ fn resolve_associated_item<'tcx>(
|
||||
})
|
||||
}
|
||||
} else if Some(trait_ref.def_id) == lang_items.future_trait() {
|
||||
let ty::Coroutine(coroutine_def_id, args, _) = *rcvr_args.type_at(0).kind() else {
|
||||
let ty::Coroutine(coroutine_def_id, args) = *rcvr_args.type_at(0).kind() else {
|
||||
bug!()
|
||||
};
|
||||
if Some(trait_item_id) == tcx.lang_items().future_poll_fn() {
|
||||
@@ -259,7 +259,7 @@ fn resolve_associated_item<'tcx>(
|
||||
Some(Instance::new(trait_item_id, rcvr_args))
|
||||
}
|
||||
} else if Some(trait_ref.def_id) == lang_items.iterator_trait() {
|
||||
let ty::Coroutine(coroutine_def_id, args, _) = *rcvr_args.type_at(0).kind() else {
|
||||
let ty::Coroutine(coroutine_def_id, args) = *rcvr_args.type_at(0).kind() else {
|
||||
bug!()
|
||||
};
|
||||
if Some(trait_item_id) == tcx.lang_items().next_fn() {
|
||||
@@ -272,7 +272,7 @@ fn resolve_associated_item<'tcx>(
|
||||
Some(Instance::new(trait_item_id, rcvr_args))
|
||||
}
|
||||
} else if Some(trait_ref.def_id) == lang_items.async_iterator_trait() {
|
||||
let ty::Coroutine(coroutine_def_id, args, _) = *rcvr_args.type_at(0).kind() else {
|
||||
let ty::Coroutine(coroutine_def_id, args) = *rcvr_args.type_at(0).kind() else {
|
||||
bug!()
|
||||
};
|
||||
|
||||
@@ -287,7 +287,7 @@ fn resolve_associated_item<'tcx>(
|
||||
// `AsyncIterator::poll_next` is generated by the compiler.
|
||||
Some(Instance { def: ty::InstanceDef::Item(coroutine_def_id), args })
|
||||
} else if Some(trait_ref.def_id) == lang_items.coroutine_trait() {
|
||||
let ty::Coroutine(coroutine_def_id, args, _) = *rcvr_args.type_at(0).kind() else {
|
||||
let ty::Coroutine(coroutine_def_id, args) = *rcvr_args.type_at(0).kind() else {
|
||||
bug!()
|
||||
};
|
||||
if cfg!(debug_assertions) && tcx.item_name(trait_item_id) != sym::resume {
|
||||
|
||||
Reference in New Issue
Block a user