s/Generator/Coroutine/
This commit is contained in:
@@ -97,7 +97,7 @@ fn fn_sig_for_fn_abi<'tcx>(
|
||||
bound_vars,
|
||||
)
|
||||
}
|
||||
ty::Generator(did, args, _) => {
|
||||
ty::Coroutine(did, args, _) => {
|
||||
let sig = args.as_generator().poly_sig();
|
||||
|
||||
let bound_vars = tcx.mk_bound_variable_kinds_from_iter(
|
||||
@@ -117,7 +117,7 @@ fn fn_sig_for_fn_abi<'tcx>(
|
||||
|
||||
let sig = sig.skip_binder();
|
||||
// The `FnSig` and the `ret_ty` here is for a generators main
|
||||
// `Generator::resume(...) -> GeneratorState` function in case we
|
||||
// `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) {
|
||||
@@ -143,8 +143,8 @@ fn fn_sig_for_fn_abi<'tcx>(
|
||||
|
||||
(context_mut_ref, ret_ty)
|
||||
} else {
|
||||
// The signature should be `Generator::resume(_, Resume) -> GeneratorState<Yield, Return>`
|
||||
let state_did = tcx.require_lang_item(LangItem::GeneratorState, None);
|
||||
// The signature should be `Coroutine::resume(_, Resume) -> CoroutineState<Yield, Return>`
|
||||
let state_did = tcx.require_lang_item(LangItem::CoroutineState, None);
|
||||
let state_adt_ref = tcx.adt_def(state_did);
|
||||
let state_args = tcx.mk_args(&[sig.yield_ty.into(), sig.return_ty.into()]);
|
||||
let ret_ty = Ty::new_adt(tcx, state_adt_ref, state_args);
|
||||
|
||||
Reference in New Issue
Block a user