s/Generator/Coroutine/

This commit is contained in:
Oli Scherer 2023-10-19 16:06:43 +00:00
parent 96027d945b
commit 60956837cf
310 changed files with 1271 additions and 1271 deletions

View file

@ -1394,7 +1394,7 @@ fn opaque_type_cycle_error(
self.opaques.push(def);
ControlFlow::Continue(())
}
ty::Closure(def_id, ..) | ty::Generator(def_id, ..) => {
ty::Closure(def_id, ..) | ty::Coroutine(def_id, ..) => {
self.closures.push(def_id);
t.super_visit_with(self)
}
@ -1447,7 +1447,7 @@ fn opaque_type_cycle_error(
label_match(capture.place.ty(), capture.get_path_span(tcx));
}
// Label any generator locals that capture the opaque
if let DefKind::Generator = tcx.def_kind(closure_def_id)
if let DefKind::Coroutine = tcx.def_kind(closure_def_id)
&& let Some(generator_layout) = tcx.mir_generator_witnesses(closure_def_id)
{
for interior_ty in &generator_layout.field_tys {
@ -1465,7 +1465,7 @@ fn opaque_type_cycle_error(
}
pub(super) fn check_generator_obligations(tcx: TyCtxt<'_>, def_id: LocalDefId) {
debug_assert!(matches!(tcx.def_kind(def_id), DefKind::Generator));
debug_assert!(matches!(tcx.def_kind(def_id), DefKind::Coroutine));
let typeck = tcx.typeck(def_id);
let param_env = tcx.param_env(def_id);
@ -1500,7 +1500,7 @@ pub(super) fn check_generator_obligations(tcx: TyCtxt<'_>, def_id: LocalDefId) {
ObligationCause::new(
field_ty.source_info.span,
def_id,
ObligationCauseCode::SizedGeneratorInterior(def_id),
ObligationCauseCode::SizedCoroutineInterior(def_id),
),
);
}

View file

@ -155,8 +155,8 @@ impl<'tcx> InherentCollect<'tcx> {
}
ty::FnDef(..)
| ty::Closure(..)
| ty::Generator(..)
| ty::GeneratorWitness(..)
| ty::Coroutine(..)
| ty::CoroutineWitness(..)
| ty::Bound(..)
| ty::Placeholder(_)
| ty::Infer(_) => {

View file

@ -243,8 +243,8 @@ fn do_orphan_check_impl<'tcx>(
| ty::Tuple(..) => (LocalImpl::Allow, NonlocalImpl::DisallowOther),
ty::Closure(..)
| ty::Generator(..)
| ty::GeneratorWitness(..)
| ty::Coroutine(..)
| ty::CoroutineWitness(..)
| ty::Bound(..)
| ty::Placeholder(..)
| ty::Infer(..) => {

View file

@ -1548,7 +1548,7 @@ fn compute_sig_of_foreign_fn_decl<'tcx>(
fty
}
fn generator_kind(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Option<hir::GeneratorKind> {
fn generator_kind(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Option<hir::CoroutineKind> {
match tcx.hir().get_by_def_id(def_id) {
Node::Expr(&rustc_hir::Expr {
kind: rustc_hir::ExprKind::Closure(&rustc_hir::Closure { body, .. }),

View file

@ -235,7 +235,7 @@ impl<'a, 'tcx> ConstraintContext<'a, 'tcx> {
// leaf type -- noop
}
ty::FnDef(..) | ty::Generator(..) | ty::Closure(..) => {
ty::FnDef(..) | ty::Coroutine(..) | ty::Closure(..) => {
bug!("Unexpected closure type in variance computation");
}
@ -312,7 +312,7 @@ impl<'a, 'tcx> ConstraintContext<'a, 'tcx> {
// types, where we use Error as the Self type
}
ty::Placeholder(..) | ty::GeneratorWitness(..) | ty::Bound(..) | ty::Infer(..) => {
ty::Placeholder(..) | ty::CoroutineWitness(..) | ty::Bound(..) | ty::Infer(..) => {
bug!("unexpected type encountered in variance inference: {}", ty);
}
}