about summary refs log tree commit diff
path: root/compiler/rustc_lint/src
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2024-12-11 01:37:17 +0000
committerEsteban Küber <esteban@kuber.com.ar>2024-12-23 03:01:29 +0000
commit1f82b45b6a42eca19a9dc48402abdc02574f791d (patch)
treece418466d0d65b18070a26934ea86a16cbe71829 /compiler/rustc_lint/src
parente108481f74ff123ad98a63bd107a18d13035b275 (diff)
downloadrust-1f82b45b6a42eca19a9dc48402abdc02574f791d.tar.gz
rust-1f82b45b6a42eca19a9dc48402abdc02574f791d.zip
Use `#[derive(Default)]` instead of manually implementing it
Diffstat (limited to 'compiler/rustc_lint/src')
-rw-r--r--compiler/rustc_lint/src/unused.rs7
1 files changed, 1 insertions, 6 deletions
diff --git a/compiler/rustc_lint/src/unused.rs b/compiler/rustc_lint/src/unused.rs
index 2b3cb14f9e9..8b1526bc747 100644
--- a/compiler/rustc_lint/src/unused.rs
+++ b/compiler/rustc_lint/src/unused.rs
@@ -1023,6 +1023,7 @@ declare_lint! {
     "`if`, `match`, `while` and `return` do not need parentheses"
 }
 
+#[derive(Default)]
 pub(crate) struct UnusedParens {
     with_self_ty_parens: bool,
     /// `1 as (i32) < 2` parses to ExprKind::Lt
@@ -1030,12 +1031,6 @@ pub(crate) struct UnusedParens {
     parens_in_cast_in_lt: Vec<ast::NodeId>,
 }
 
-impl Default for UnusedParens {
-    fn default() -> Self {
-        Self { with_self_ty_parens: false, parens_in_cast_in_lt: Vec::new() }
-    }
-}
-
 impl_lint_pass!(UnusedParens => [UNUSED_PARENS]);
 
 impl UnusedDelimLint for UnusedParens {