Skip to content

Commit 1d8f3b5

Browse files
author
Jackson Lewis
committed
Unnecessary -> Unused
1 parent c6e0e84 commit 1d8f3b5

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

clippy_lints/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ mod unnamed_address;
360360
mod unnecessary_self_imports;
361361
mod unnecessary_sort_by;
362362
mod unnecessary_wraps;
363-
mod unnecessary_async;
363+
mod unused_async;
364364
mod unnested_or_patterns;
365365
mod unsafe_removed_from_name;
366366
mod unused_io_amount;
@@ -955,7 +955,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
955955
unit_types::UNIT_CMP,
956956
unnamed_address::FN_ADDRESS_COMPARISONS,
957957
unnamed_address::VTABLE_ADDRESS_COMPARISONS,
958-
unnecessary_async::UNNECESSARY_ASYNC,
958+
unused_async::UNUSED_ASYNC,
959959
unnecessary_self_imports::UNNECESSARY_SELF_IMPORTS,
960960
unnecessary_sort_by::UNNECESSARY_SORT_BY,
961961
unnecessary_wraps::UNNECESSARY_WRAPS,
@@ -1273,7 +1273,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
12731273
store.register_late_pass(|| box manual_map::ManualMap);
12741274
store.register_late_pass(move || box if_then_some_else_none::IfThenSomeElseNone::new(msrv));
12751275
store.register_early_pass(|| box bool_assert_comparison::BoolAssertComparison);
1276-
store.register_late_pass(|| box unnecessary_async::UnnecessaryAsync);
1276+
store.register_late_pass(|| box unused_async::UnusedAsync);
12771277

12781278
store.register_group(true, "clippy::restriction", Some("clippy_restriction"), vec![
12791279
LintId::of(arithmetic::FLOAT_ARITHMETIC),
@@ -1415,7 +1415,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
14151415
LintId::of(unicode::NON_ASCII_LITERAL),
14161416
LintId::of(unicode::UNICODE_NOT_NFC),
14171417
LintId::of(unit_types::LET_UNIT_VALUE),
1418-
LintId::of(unnecessary_async::UNNECESSARY_ASYNC),
1418+
LintId::of(unused_async::UNUSED_ASYNC),
14191419
LintId::of(unnecessary_wraps::UNNECESSARY_WRAPS),
14201420
LintId::of(unnested_or_patterns::UNNESTED_OR_PATTERNS),
14211421
LintId::of(unused_self::UNUSED_SELF),

clippy_lints/src/unnecessary_async.rs renamed to clippy_lints/src/unused_async.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ declare_clippy_lint! {
3030
/// }
3131
/// let number_future = async { get_random_number_improved() };
3232
/// ```
33-
pub UNNECESSARY_ASYNC,
33+
pub UNUSED_ASYNC,
3434
pedantic,
3535
"finds async functions with no await statements"
3636
}
3737

38-
declare_lint_pass!(UnnecessaryAsync => [UNNECESSARY_ASYNC]);
38+
declare_lint_pass!(UnusedAsync => [UNUSED_ASYNC]);
3939

4040
struct AsyncFnVisitor<'a, 'tcx> {
4141
cx: &'a LateContext<'tcx>,
@@ -57,7 +57,7 @@ impl<'a, 'tcx> Visitor<'tcx> for AsyncFnVisitor<'a, 'tcx> {
5757
}
5858
}
5959

60-
impl<'tcx> LateLintPass<'tcx> for UnnecessaryAsync {
60+
impl<'tcx> LateLintPass<'tcx> for UnusedAsync {
6161
fn check_item(&mut self, _: &LateContext<'tcx>, item: &'tcx Item<'tcx>) {
6262
if let ItemKind::Trait(..) = item.kind {
6363
return;
@@ -79,9 +79,9 @@ impl<'tcx> LateLintPass<'tcx> for UnnecessaryAsync {
7979
if !visitor.found_await {
8080
span_lint_and_help(
8181
cx,
82-
UNNECESSARY_ASYNC,
82+
UNUSED_ASYNC,
8383
span,
84-
"unnecessary `async` for function with no await statements",
84+
"unused `async` for function with no await statements",
8585
None,
8686
"consider removing the `async` from this function",
8787
);

tests/ui/unnecessary_async.rs renamed to tests/ui/unused_async.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// edition:2018
2-
#![warn(clippy::unnecessary_async)]
2+
#![warn(clippy::unused_async)]
33

44
async fn foo() -> i32 {
55
4

tests/ui/unnecessary_async.stderr renamed to tests/ui/unused_async.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
error: unnecessary `async` for function with no await statements
2-
--> $DIR/unnecessary_async.rs:4:1
1+
error: unused `async` for function with no await statements
2+
--> $DIR/unused_async.rs:4:1
33
|
44
LL | / async fn foo() -> i32 {
55
LL | | 4
66
LL | | }
77
| |_^
88
|
9-
= note: `-D clippy::unnecessary-async` implied by `-D warnings`
9+
= note: `-D clippy::unused-async` implied by `-D warnings`
1010
= help: consider removing the `async` from this function
1111

1212
error: aborting due to previous error

0 commit comments

Comments
 (0)