diff options
Diffstat (limited to 'compiler/rustc_lint/src')
| -rw-r--r-- | compiler/rustc_lint/src/foreign_modules.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_lint/src/lints.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_lint/src/types.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_lint/src/unused.rs | 14 |
4 files changed, 12 insertions, 12 deletions
diff --git a/compiler/rustc_lint/src/foreign_modules.rs b/compiler/rustc_lint/src/foreign_modules.rs index b81e84fafac..86b3b4ad0ca 100644 --- a/compiler/rustc_lint/src/foreign_modules.rs +++ b/compiler/rustc_lint/src/foreign_modules.rs @@ -369,8 +369,8 @@ fn structurally_same_type_impl<'tcx>( (Dynamic(..), Dynamic(..)) | (Error(..), Error(..)) | (Closure(..), Closure(..)) - | (Generator(..), Generator(..)) - | (GeneratorWitness(..), GeneratorWitness(..)) + | (Coroutine(..), Coroutine(..)) + | (CoroutineWitness(..), CoroutineWitness(..)) | (Alias(ty::Projection, ..), Alias(ty::Projection, ..)) | (Alias(ty::Inherent, ..), Alias(ty::Inherent, ..)) | (Alias(ty::Opaque, ..), Alias(ty::Opaque, ..)) => false, diff --git a/compiler/rustc_lint/src/lints.rs b/compiler/rustc_lint/src/lints.rs index 4eaf8bbf5de..ce52e95e0f1 100644 --- a/compiler/rustc_lint/src/lints.rs +++ b/compiler/rustc_lint/src/lints.rs @@ -1702,7 +1702,7 @@ pub struct UnusedClosure<'a> { #[derive(LintDiagnostic)] #[diag(lint_unused_generator)] #[note] -pub struct UnusedGenerator<'a> { +pub struct UnusedCoroutine<'a> { pub count: usize, pub pre: &'a str, pub post: &'a str, diff --git a/compiler/rustc_lint/src/types.rs b/compiler/rustc_lint/src/types.rs index f89b63e6f9f..c04053d1865 100644 --- a/compiler/rustc_lint/src/types.rs +++ b/compiler/rustc_lint/src/types.rs @@ -1272,8 +1272,8 @@ impl<'a, 'tcx> ImproperCTypesVisitor<'a, 'tcx> { | ty::Bound(..) | ty::Error(_) | ty::Closure(..) - | ty::Generator(..) - | ty::GeneratorWitness(..) + | ty::Coroutine(..) + | ty::CoroutineWitness(..) | ty::Placeholder(..) | ty::FnDef(..) => bug!("unexpected type in foreign function: {:?}", ty), } diff --git a/compiler/rustc_lint/src/unused.rs b/compiler/rustc_lint/src/unused.rs index 65de7e10272..c757bc85021 100644 --- a/compiler/rustc_lint/src/unused.rs +++ b/compiler/rustc_lint/src/unused.rs @@ -1,7 +1,7 @@ use crate::lints::{ PathStatementDrop, PathStatementDropSub, PathStatementNoEffect, UnusedAllocationDiag, - UnusedAllocationMutDiag, UnusedClosure, UnusedDef, UnusedDefSuggestion, UnusedDelim, - UnusedDelimSuggestion, UnusedGenerator, UnusedImportBracesDiag, UnusedOp, UnusedOpSuggestion, + UnusedAllocationMutDiag, UnusedClosure, UnusedCoroutine, UnusedDef, UnusedDefSuggestion, + UnusedDelim, UnusedDelimSuggestion, UnusedImportBracesDiag, UnusedOp, UnusedOpSuggestion, UnusedResult, }; use crate::Lint; @@ -258,7 +258,7 @@ impl<'tcx> LateLintPass<'tcx> for UnusedResults { /// The root of the unused_closures lint. Closure(Span), /// The root of the unused_generators lint. - Generator(Span), + Coroutine(Span), } #[instrument(skip(cx, expr), level = "debug", ret)] @@ -350,7 +350,7 @@ impl<'tcx> LateLintPass<'tcx> for UnusedResults { .map(|inner| MustUsePath::Array(Box::new(inner), len)), }, ty::Closure(..) => Some(MustUsePath::Closure(span)), - ty::Generator(def_id, ..) => { + ty::Coroutine(def_id, ..) => { // async fn should be treated as "implementor of `Future`" let must_use = if cx.tcx.generator_is_async(def_id) { let def_id = cx.tcx.lang_items().future_trait()?; @@ -359,7 +359,7 @@ impl<'tcx> LateLintPass<'tcx> for UnusedResults { } else { None }; - must_use.or(Some(MustUsePath::Generator(span))) + must_use.or(Some(MustUsePath::Coroutine(span))) } _ => None, } @@ -482,11 +482,11 @@ impl<'tcx> LateLintPass<'tcx> for UnusedResults { UnusedClosure { count: plural_len, pre: descr_pre, post: descr_post }, ); } - MustUsePath::Generator(span) => { + MustUsePath::Coroutine(span) => { cx.emit_spanned_lint( UNUSED_MUST_USE, *span, - UnusedGenerator { count: plural_len, pre: descr_pre, post: descr_post }, + UnusedCoroutine { count: plural_len, pre: descr_pre, post: descr_post }, ); } MustUsePath::Def(span, def_id, reason) => { |
