summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_monomorphize/src/polymorphize.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 05:48:48 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 05:48:48 +0000
commitef24de24a82fe681581cc130f342363c47c0969a (patch)
tree0d494f7e1a38b95c92426f58fe6eaa877303a86c /compiler/rustc_monomorphize/src/polymorphize.rs
parentReleasing progress-linux version 1.74.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-ef24de24a82fe681581cc130f342363c47c0969a.tar.xz
rustc-ef24de24a82fe681581cc130f342363c47c0969a.zip
Merging upstream version 1.75.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'compiler/rustc_monomorphize/src/polymorphize.rs')
-rw-r--r--compiler/rustc_monomorphize/src/polymorphize.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/compiler/rustc_monomorphize/src/polymorphize.rs b/compiler/rustc_monomorphize/src/polymorphize.rs
index 6c206a6ba..a3b35eab4 100644
--- a/compiler/rustc_monomorphize/src/polymorphize.rs
+++ b/compiler/rustc_monomorphize/src/polymorphize.rs
@@ -131,7 +131,7 @@ fn mark_used_by_default_parameters<'tcx>(
unused_parameters: &mut UnusedGenericParams,
) {
match tcx.def_kind(def_id) {
- DefKind::Closure | DefKind::Generator => {
+ DefKind::Closure | DefKind::Coroutine => {
for param in &generics.params {
debug!(?param, "(closure/gen)");
unused_parameters.mark_used(param.index);
@@ -227,7 +227,7 @@ struct MarkUsedGenericParams<'a, 'tcx> {
impl<'a, 'tcx> MarkUsedGenericParams<'a, 'tcx> {
/// Invoke `unused_generic_params` on a body contained within the current item (e.g.
- /// a closure, generator or constant).
+ /// a closure, coroutine or constant).
#[instrument(level = "debug", skip(self, def_id, args))]
fn visit_child_body(&mut self, def_id: DefId, args: GenericArgsRef<'tcx>) {
let instance = ty::InstanceDef::Item(def_id);
@@ -248,8 +248,8 @@ impl<'a, 'tcx> Visitor<'tcx> for MarkUsedGenericParams<'a, 'tcx> {
fn visit_local_decl(&mut self, local: Local, local_decl: &LocalDecl<'tcx>) {
if local == Local::from_usize(1) {
let def_kind = self.tcx.def_kind(self.def_id);
- if matches!(def_kind, DefKind::Closure | DefKind::Generator) {
- // Skip visiting the closure/generator that is currently being processed. This only
+ if matches!(def_kind, DefKind::Closure | DefKind::Coroutine) {
+ // Skip visiting the closure/coroutine that is currently being processed. This only
// happens because the first argument to the closure is a reference to itself and
// that will call `visit_args`, resulting in each generic parameter captured being
// considered used by default.
@@ -319,14 +319,14 @@ impl<'a, 'tcx> TypeVisitor<TyCtxt<'tcx>> for MarkUsedGenericParams<'a, 'tcx> {
}
match *ty.kind() {
- ty::Closure(def_id, args) | ty::Generator(def_id, args, ..) => {
+ ty::Closure(def_id, args) | ty::Coroutine(def_id, args, ..) => {
debug!(?def_id);
- // Avoid cycle errors with generators.
+ // Avoid cycle errors with coroutines.
if def_id == self.def_id {
return ControlFlow::Continue(());
}
- // Consider any generic parameters used by any closures/generators as used in the
+ // Consider any generic parameters used by any closures/coroutines as used in the
// parent.
self.visit_child_body(def_id, args);
ControlFlow::Continue(())