diff options
Diffstat (limited to 'compiler/rustc_lint')
| -rw-r--r-- | compiler/rustc_lint/messages.ftl | 14 | ||||
| -rw-r--r-- | compiler/rustc_lint/src/lints.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_lint/src/unused.rs | 4 | 
3 files changed, 10 insertions, 10 deletions
diff --git a/compiler/rustc_lint/messages.ftl b/compiler/rustc_lint/messages.ftl index 4c4d2933bf4..068f1372c0e 100644 --- a/compiler/rustc_lint/messages.ftl +++ b/compiler/rustc_lint/messages.ftl @@ -551,19 +551,19 @@ lint_unused_closure = lint_unused_comparisons = comparison is useless due to type limits +lint_unused_coroutine = + unused {$pre}{$count -> + [one] coroutine + *[other] coroutine + }{$post} that must be used + .note = coroutines are lazy and do nothing unless resumed + lint_unused_def = unused {$pre}`{$def}`{$post} that must be used .suggestion = use `let _ = ...` to ignore the resulting value lint_unused_delim = unnecessary {$delim} around {$item} .suggestion = remove these {$delim} -lint_unused_generator = - unused {$pre}{$count -> - [one] generator - *[other] generator - }{$post} that must be used - .note = generators are lazy and do nothing unless resumed - lint_unused_import_braces = braces around {$node} is unnecessary lint_unused_op = unused {$op} that must be used diff --git a/compiler/rustc_lint/src/lints.rs b/compiler/rustc_lint/src/lints.rs index ce52e95e0f1..756899e50a8 100644 --- a/compiler/rustc_lint/src/lints.rs +++ b/compiler/rustc_lint/src/lints.rs @@ -1700,7 +1700,7 @@ pub struct UnusedClosure<'a> { // FIXME(davidtwco): this isn't properly translatable because of the // pre/post strings #[derive(LintDiagnostic)] -#[diag(lint_unused_generator)] +#[diag(lint_unused_coroutine)] #[note] pub struct UnusedCoroutine<'a> { pub count: usize, diff --git a/compiler/rustc_lint/src/unused.rs b/compiler/rustc_lint/src/unused.rs index c757bc85021..6b31fb079e0 100644 --- a/compiler/rustc_lint/src/unused.rs +++ b/compiler/rustc_lint/src/unused.rs @@ -257,7 +257,7 @@ impl<'tcx> LateLintPass<'tcx> for UnusedResults { Array(Box<Self>, u64), /// The root of the unused_closures lint. Closure(Span), - /// The root of the unused_generators lint. + /// The root of the unused_coroutines lint. Coroutine(Span), } @@ -352,7 +352,7 @@ impl<'tcx> LateLintPass<'tcx> for UnusedResults { ty::Closure(..) => Some(MustUsePath::Closure(span)), 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 must_use = if cx.tcx.coroutine_is_async(def_id) { let def_id = cx.tcx.lang_items().future_trait()?; is_def_must_use(cx, def_id, span) .map(|inner| MustUsePath::Opaque(Box::new(inner)))  | 
