Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move let_underscore_drop to restriction #9696

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions clippy_lints/src/let_underscore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ declare_clippy_lint! {

declare_clippy_lint! {
/// ### What it does
/// Checks for `let _ = <expr>`
/// where expr has a type that implements `Drop`
/// Checks for `let _ = <expr>` where expr has a type that implements `Drop`
///
/// ### Why is this bad?
/// This statement immediately drops the initializer
Expand Down Expand Up @@ -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`"
}

Expand Down
1 change: 0 additions & 1 deletion clippy_lints/src/lib.register_pedantic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
1 change: 1 addition & 0 deletions clippy_lints/src/lib.register_restriction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion lintcheck/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
});
Expand Down
3 changes: 1 addition & 2 deletions src/docs/let_underscore_drop.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
### What it does
Checks for `let _ = <expr>`
where expr has a type that implements `Drop`
Checks for `let _ = <expr>` where expr has a type that implements `Drop`

### Why is this bad?
This statement immediately drops the initializer
Expand Down