s/generator/coroutine/

This commit is contained in:
Oli Scherer
2023-10-19 21:46:28 +00:00
parent 60956837cf
commit e96ce20b34
468 changed files with 2201 additions and 2197 deletions

View File

@@ -98,7 +98,7 @@ fn fn_sig_for_fn_abi<'tcx>(
)
}
ty::Coroutine(did, args, _) => {
let sig = args.as_generator().poly_sig();
let sig = args.as_coroutine().poly_sig();
let bound_vars = tcx.mk_bound_variable_kinds_from_iter(
sig.bound_vars().iter().chain(iter::once(ty::BoundVariableKind::Region(ty::BrEnv))),
@@ -116,11 +116,11 @@ fn fn_sig_for_fn_abi<'tcx>(
let env_ty = Ty::new_adt(tcx, pin_adt_ref, pin_args);
let sig = sig.skip_binder();
// The `FnSig` and the `ret_ty` here is for a generators main
// The `FnSig` and the `ret_ty` here is for a coroutines main
// `Coroutine::resume(...) -> CoroutineState` function in case we
// have an ordinary generator, or the `Future::poll(...) -> Poll`
// function in case this is a special generator backing an async construct.
let (resume_ty, ret_ty) = if tcx.generator_is_async(did) {
// have an ordinary coroutine, or the `Future::poll(...) -> Poll`
// function in case this is a special coroutine backing an async construct.
let (resume_ty, ret_ty) = if tcx.coroutine_is_async(did) {
// The signature should be `Future::poll(_, &mut Context<'_>) -> Poll<Output>`
let poll_did = tcx.require_lang_item(LangItem::Poll, None);
let poll_adt_ref = tcx.adt_def(poll_did);