s/Generator/Coroutine/
This commit is contained in:
parent
96027d945b
commit
60956837cf
310 changed files with 1271 additions and 1271 deletions
|
@ -457,8 +457,8 @@ impl<'cx, 'tcx> TypeFolder<TyCtxt<'tcx>> for Canonicalizer<'cx, 'tcx> {
|
|||
}
|
||||
|
||||
ty::Closure(..)
|
||||
| ty::Generator(..)
|
||||
| ty::GeneratorWitness(..)
|
||||
| ty::Coroutine(..)
|
||||
| ty::CoroutineWitness(..)
|
||||
| ty::Bool
|
||||
| ty::Char
|
||||
| ty::Int(..)
|
||||
|
|
|
@ -2936,7 +2936,7 @@ pub enum TyCategory {
|
|||
Closure,
|
||||
Opaque,
|
||||
OpaqueFuture,
|
||||
Generator(hir::GeneratorKind),
|
||||
Coroutine(hir::CoroutineKind),
|
||||
Foreign,
|
||||
}
|
||||
|
||||
|
@ -2946,7 +2946,7 @@ impl TyCategory {
|
|||
Self::Closure => "closure",
|
||||
Self::Opaque => "opaque type",
|
||||
Self::OpaqueFuture => "future",
|
||||
Self::Generator(gk) => gk.descr(),
|
||||
Self::Coroutine(gk) => gk.descr(),
|
||||
Self::Foreign => "foreign type",
|
||||
}
|
||||
}
|
||||
|
@ -2959,8 +2959,8 @@ impl TyCategory {
|
|||
if tcx.ty_is_opaque_future(ty) { Self::OpaqueFuture } else { Self::Opaque };
|
||||
Some((kind, def_id))
|
||||
}
|
||||
ty::Generator(def_id, ..) => {
|
||||
Some((Self::Generator(tcx.generator_kind(def_id).unwrap()), def_id))
|
||||
ty::Coroutine(def_id, ..) => {
|
||||
Some((Self::Coroutine(tcx.generator_kind(def_id).unwrap()), def_id))
|
||||
}
|
||||
ty::Foreign(def_id) => Some((Self::Foreign, def_id)),
|
||||
_ => None,
|
||||
|
|
|
@ -864,7 +864,7 @@ impl<'a, 'tcx> FindInferSourceVisitor<'a, 'tcx> {
|
|||
GenericArgKind::Type(ty) => {
|
||||
if matches!(
|
||||
ty.kind(),
|
||||
ty::Alias(ty::Opaque, ..) | ty::Closure(..) | ty::Generator(..)
|
||||
ty::Alias(ty::Opaque, ..) | ty::Closure(..) | ty::Coroutine(..)
|
||||
) {
|
||||
// Opaque types can't be named by the user right now.
|
||||
//
|
||||
|
|
|
@ -215,7 +215,7 @@ impl<T> Trait<T> for X {
|
|||
#traits-as-parameters",
|
||||
);
|
||||
}
|
||||
(ty::Param(p), ty::Closure(..) | ty::Generator(..)) => {
|
||||
(ty::Param(p), ty::Closure(..) | ty::Coroutine(..)) => {
|
||||
let generics = tcx.generics_of(body_owner_def_id);
|
||||
let p_span = tcx.def_span(generics.type_param(p, tcx).def_id);
|
||||
if !sp.contains(p_span) {
|
||||
|
|
|
@ -454,7 +454,7 @@ where
|
|||
args.as_closure().sig_as_fn_ptr_ty().visit_with(self);
|
||||
}
|
||||
|
||||
ty::Generator(_, ref args, _) => {
|
||||
ty::Coroutine(_, ref args, _) => {
|
||||
// Skip lifetime parameters of the enclosing item(s)
|
||||
// Also skip the witness type, because that has no free regions.
|
||||
|
||||
|
|
|
@ -102,7 +102,7 @@ fn compute_components<'tcx>(
|
|||
compute_components(tcx, tupled_ty, out, visited);
|
||||
}
|
||||
|
||||
ty::Generator(_, ref args, _) => {
|
||||
ty::Coroutine(_, ref args, _) => {
|
||||
// Same as the closure case
|
||||
let tupled_ty = args.as_generator().tupled_upvars_ty();
|
||||
compute_components(tcx, tupled_ty, out, visited);
|
||||
|
@ -112,7 +112,7 @@ fn compute_components<'tcx>(
|
|||
}
|
||||
|
||||
// All regions are bound inside a witness
|
||||
ty::GeneratorWitness(..) => (),
|
||||
ty::CoroutineWitness(..) => (),
|
||||
|
||||
// OutlivesTypeParameterEnv -- the actual checking that `X:'a`
|
||||
// is implied by the environment is done in regionck.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue