about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection/src/solve/assembly
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_trait_selection/src/solve/assembly')
-rw-r--r--compiler/rustc_trait_selection/src/solve/assembly/mod.rs14
-rw-r--r--compiler/rustc_trait_selection/src/solve/assembly/structural_traits.rs16
2 files changed, 15 insertions, 15 deletions
diff --git a/compiler/rustc_trait_selection/src/solve/assembly/mod.rs b/compiler/rustc_trait_selection/src/solve/assembly/mod.rs
index 68f872308a7..0c214ca8753 100644
--- a/compiler/rustc_trait_selection/src/solve/assembly/mod.rs
+++ b/compiler/rustc_trait_selection/src/solve/assembly/mod.rs
@@ -191,18 +191,18 @@ pub(super) trait GoalKind<'tcx>:
         goal: Goal<'tcx, Self>,
     ) -> QueryResult<'tcx>;
 
-    /// A generator (that comes from an `async` desugaring) is known to implement
-    /// `Future<Output = O>`, where `O` is given by the generator's return type
+    /// A coroutine (that comes from an `async` desugaring) is known to implement
+    /// `Future<Output = O>`, where `O` is given by the coroutine's return type
     /// that was computed during type-checking.
     fn consider_builtin_future_candidate(
         ecx: &mut EvalCtxt<'_, 'tcx>,
         goal: Goal<'tcx, Self>,
     ) -> QueryResult<'tcx>;
 
-    /// A generator (that doesn't come from an `async` desugaring) is known to
+    /// A coroutine (that doesn't come from an `async` desugaring) is known to
     /// implement `Coroutine<R, Yield = Y, Return = O>`, given the resume, yield,
-    /// and return types of the generator computed during type-checking.
-    fn consider_builtin_generator_candidate(
+    /// and return types of the coroutine computed during type-checking.
+    fn consider_builtin_coroutine_candidate(
         ecx: &mut EvalCtxt<'_, 'tcx>,
         goal: Goal<'tcx, Self>,
     ) -> QueryResult<'tcx>;
@@ -467,7 +467,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
             ty::Alias(_, _) | ty::Placeholder(..) | ty::Error(_) => (),
 
             // FIXME: These should ideally not exist as a self type. It would be nice for
-            // the builtin auto trait impls of generators to instead directly recurse
+            // the builtin auto trait impls of coroutines to instead directly recurse
             // into the witness.
             ty::CoroutineWitness(..) => (),
 
@@ -553,7 +553,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
         } else if lang_items.future_trait() == Some(trait_def_id) {
             G::consider_builtin_future_candidate(self, goal)
         } else if lang_items.gen_trait() == Some(trait_def_id) {
-            G::consider_builtin_generator_candidate(self, goal)
+            G::consider_builtin_coroutine_candidate(self, goal)
         } else if lang_items.discriminant_kind_trait() == Some(trait_def_id) {
             G::consider_builtin_discriminant_kind_candidate(self, goal)
         } else if lang_items.destruct_trait() == Some(trait_def_id) {
diff --git a/compiler/rustc_trait_selection/src/solve/assembly/structural_traits.rs b/compiler/rustc_trait_selection/src/solve/assembly/structural_traits.rs
index afe1424daca..d655a4106b8 100644
--- a/compiler/rustc_trait_selection/src/solve/assembly/structural_traits.rs
+++ b/compiler/rustc_trait_selection/src/solve/assembly/structural_traits.rs
@@ -12,7 +12,7 @@ use crate::solve::EvalCtxt;
 
 // Calculates the constituent types of a type for `auto trait` purposes.
 //
-// For types with an "existential" binder, i.e. generator witnesses, we also
+// For types with an "existential" binder, i.e. coroutine witnesses, we also
 // instantiate the binder with placeholders eagerly.
 pub(in crate::solve) fn instantiate_constituent_tys_for_auto_trait<'tcx>(
     ecx: &EvalCtxt<'_, 'tcx>,
@@ -57,13 +57,13 @@ pub(in crate::solve) fn instantiate_constituent_tys_for_auto_trait<'tcx>(
         ty::Closure(_, ref args) => Ok(vec![args.as_closure().tupled_upvars_ty()]),
 
         ty::Coroutine(_, ref args, _) => {
-            let generator_args = args.as_generator();
-            Ok(vec![generator_args.tupled_upvars_ty(), generator_args.witness()])
+            let coroutine_args = args.as_coroutine();
+            Ok(vec![coroutine_args.tupled_upvars_ty(), coroutine_args.witness()])
         }
 
         ty::CoroutineWitness(def_id, args) => Ok(ecx
             .tcx()
-            .generator_hidden_types(def_id)
+            .coroutine_hidden_types(def_id)
             .map(|bty| {
                 ecx.instantiate_binder_with_placeholders(replace_erased_lifetimes_with_bound_vars(
                     tcx,
@@ -192,9 +192,9 @@ pub(in crate::solve) fn instantiate_constituent_tys_for_copy_clone_trait<'tcx>(
         ty::Closure(_, args) => Ok(vec![args.as_closure().tupled_upvars_ty()]),
 
         ty::Coroutine(_, args, Movability::Movable) => {
-            if ecx.tcx().features().generator_clone {
-                let generator = args.as_generator();
-                Ok(vec![generator.tupled_upvars_ty(), generator.witness()])
+            if ecx.tcx().features().coroutine_clone {
+                let coroutine = args.as_coroutine();
+                Ok(vec![coroutine.tupled_upvars_ty(), coroutine.witness()])
             } else {
                 Err(NoSolution)
             }
@@ -202,7 +202,7 @@ pub(in crate::solve) fn instantiate_constituent_tys_for_copy_clone_trait<'tcx>(
 
         ty::CoroutineWitness(def_id, args) => Ok(ecx
             .tcx()
-            .generator_hidden_types(def_id)
+            .coroutine_hidden_types(def_id)
             .map(|bty| {
                 ecx.instantiate_binder_with_placeholders(replace_erased_lifetimes_with_bound_vars(
                     ecx.tcx(),