From b495d0910034d8a6656eae756a83d56cbd3b021b Mon Sep 17 00:00:00 2001 From: Alex Macleod Date: Sun, 23 Oct 2022 11:57:11 +0000 Subject: [PATCH] Move `let_underscore_drop` to restriction --- clippy_lints/src/let_underscore.rs | 5 ++--- clippy_lints/src/lib.register_pedantic.rs | 1 - clippy_lints/src/lib.register_restriction.rs | 1 + lintcheck/src/main.rs | 2 +- src/docs/let_underscore_drop.txt | 3 +-- 5 files changed, 5 insertions(+), 7 deletions(-) diff --git a/clippy_lints/src/let_underscore.rs b/clippy_lints/src/let_underscore.rs index b7798b1c1d74..7cfa5ad0fbac 100644 --- a/clippy_lints/src/let_underscore.rs +++ b/clippy_lints/src/let_underscore.rs @@ -62,8 +62,7 @@ declare_clippy_lint! { declare_clippy_lint! { /// ### What it does - /// Checks for `let _ = ` - /// where expr has a type that implements `Drop` + /// Checks for `let _ = ` where expr has a type that implements `Drop` /// /// ### Why is this bad? /// This statement immediately drops the initializer @@ -94,7 +93,7 @@ declare_clippy_lint! { /// ``` #[clippy::version = "1.50.0"] pub LET_UNDERSCORE_DROP, - pedantic, + restriction, "non-binding let on a type that implements `Drop`" } diff --git a/clippy_lints/src/lib.register_pedantic.rs b/clippy_lints/src/lib.register_pedantic.rs index 2ead71a68fab..768b3347c2aa 100644 --- a/clippy_lints/src/lib.register_pedantic.rs +++ b/clippy_lints/src/lib.register_pedantic.rs @@ -39,7 +39,6 @@ store.register_group(true, "clippy::pedantic", Some("clippy_pedantic"), vec![ LintId::of(items_after_statements::ITEMS_AFTER_STATEMENTS), LintId::of(iter_not_returning_iterator::ITER_NOT_RETURNING_ITERATOR), LintId::of(large_stack_arrays::LARGE_STACK_ARRAYS), - LintId::of(let_underscore::LET_UNDERSCORE_DROP), LintId::of(literal_representation::LARGE_DIGIT_GROUPS), LintId::of(literal_representation::UNREADABLE_LITERAL), LintId::of(loops::EXPLICIT_INTO_ITER_LOOP), diff --git a/clippy_lints/src/lib.register_restriction.rs b/clippy_lints/src/lib.register_restriction.rs index f62d57af5b47..91520f1a3d72 100644 --- a/clippy_lints/src/lib.register_restriction.rs +++ b/clippy_lints/src/lib.register_restriction.rs @@ -28,6 +28,7 @@ store.register_group(true, "clippy::restriction", Some("clippy_restriction"), ve LintId::of(indexing_slicing::INDEXING_SLICING), LintId::of(inherent_impl::MULTIPLE_INHERENT_IMPL), LintId::of(large_include_file::LARGE_INCLUDE_FILE), + LintId::of(let_underscore::LET_UNDERSCORE_DROP), LintId::of(let_underscore::LET_UNDERSCORE_MUST_USE), LintId::of(literal_representation::DECIMAL_LITERAL_REPRESENTATION), LintId::of(matches::REST_PAT_IN_FULLY_BOUND_STRUCTS), diff --git a/lintcheck/src/main.rs b/lintcheck/src/main.rs index 54c1b80c42db..8385a4744ca0 100644 --- a/lintcheck/src/main.rs +++ b/lintcheck/src/main.rs @@ -678,7 +678,7 @@ fn main() { .unwrap(); let server = config.recursive.then(|| { - fs::remove_dir_all("target/lintcheck/shared_target_dir/recursive").unwrap_or_default(); + let _ = fs::remove_dir_all("target/lintcheck/shared_target_dir/recursive"); LintcheckServer::spawn(recursive_options) }); diff --git a/src/docs/let_underscore_drop.txt b/src/docs/let_underscore_drop.txt index 29ce9bf50ce6..0deb0a7f5941 100644 --- a/src/docs/let_underscore_drop.txt +++ b/src/docs/let_underscore_drop.txt @@ -1,6 +1,5 @@ ### What it does -Checks for `let _ = ` -where expr has a type that implements `Drop` +Checks for `let _ = ` where expr has a type that implements `Drop` ### Why is this bad? This statement immediately drops the initializer