about summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/new_without_default.fixed
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-02-27 18:28:06 +0000
committerbors <bors@rust-lang.org>2024-02-27 18:28:06 +0000
commit1e4f9e302c63ee126a4db8ec2cf3fa396dc74d52 (patch)
treea89d7d4d02abf1e0a3bb06fe9ae02b52c96a8499 /src/tools/clippy/tests/ui/new_without_default.fixed
parent8790c3cc7c23057957ba7e9248961b01ea4521a1 (diff)
parentf99056bd87af9f4489df89da4d9419da14cc54de (diff)
Auto merge of #121677 - flip1995:clippy-subtree-update, r=Manishearth
Clippy subtree update

r? `@Manishearth`
Diffstat (limited to 'src/tools/clippy/tests/ui/new_without_default.fixed')
-rw-r--r--src/tools/clippy/tests/ui/new_without_default.fixed10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/tools/clippy/tests/ui/new_without_default.fixed b/src/tools/clippy/tests/ui/new_without_default.fixed
index 1c7ba1a48c9..85408c4e17f 100644
--- a/src/tools/clippy/tests/ui/new_without_default.fixed
+++ b/src/tools/clippy/tests/ui/new_without_default.fixed
@@ -132,12 +132,18 @@ impl PrivateItem {
     } // We don't lint private items on public structs
 }
 
-struct Const;
+pub struct Const;
+
+impl Default for Const {
+    fn default() -> Self {
+        Self::new()
+    }
+}
 
 impl Const {
     pub const fn new() -> Const {
         Const
-    } // const fns can't be implemented via Default
+    } // While Default is not const, it can still call const functions, so we should lint this
 }
 
 pub struct IgnoreGenericNew;