diff options
Diffstat (limited to 'src/tools/clippy/tests/ui/new_without_default.fixed')
| -rw-r--r-- | src/tools/clippy/tests/ui/new_without_default.fixed | 10 |
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; |
