From 3365e50180bb6afddbceb8f738934d7d4c5cc40f Mon Sep 17 00:00:00 2001 From: Tetsuharu Ohzeki Date: Fri, 9 Feb 2024 23:10:43 +0900 Subject: [PATCH] clippy: Enable `forget_non_drop` rule --- Cargo.toml | 1 - crates/hir-ty/src/mir/lower.rs | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 8bec3893ce5..d562a90b009 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -170,7 +170,6 @@ useless_asref = "allow" ## Following lints should be tackled at some point borrowed_box = "allow" derived_hash_with_manual_eq = "allow" -forget_non_drop = "allow" needless_doctest_main = "allow" too_many_arguments = "allow" type_complexity = "allow" diff --git a/crates/hir-ty/src/mir/lower.rs b/crates/hir-ty/src/mir/lower.rs index 28d26c6c8ae..f4a076737aa 100644 --- a/crates/hir-ty/src/mir/lower.rs +++ b/crates/hir-ty/src/mir/lower.rs @@ -126,6 +126,10 @@ impl DropScopeToken { } } +impl Drop for DropScopeToken { + fn drop(&mut self) {} +} + // Uncomment this to make `DropScopeToken` a drop bomb. Unfortunately we can't do this in release, since // in cases that mir lowering fails, we don't handle (and don't need to handle) drop scopes so it will be // actually reached. `pop_drop_scope_assert_finished` will also detect this case, but doesn't show useful