3 #![warn(clippy::new_without_default)]
16 pub fn new() -> Self {
24 pub fn new() -> Self {
30 fn default() -> Self {
38 pub fn new(_: u32) -> Self {
43 pub struct GenericsOk<T> {
47 impl<U> Default for GenericsOk<U> {
48 fn default() -> Self {
53 impl<'c, V> GenericsOk<V> {
54 pub fn new() -> GenericsOk<V> {
63 impl<'b> Default for LtOk<'b> {
64 fn default() -> Self {
70 pub fn new() -> LtOk<'c> {
80 pub fn new() -> LtKo<'c> {
83 // FIXME: that suggestion is missing lifetimes
91 } // We don't lint private items
97 pub const fn new() -> Const {
99 } // const fns can't be implemented via Default
102 pub struct IgnoreGenericNew;
104 impl IgnoreGenericNew {
105 pub fn new<T>() -> Self {
107 } // the derived Default does not make sense here as the result depends on T
110 pub trait TraitWithNew: Sized {
116 pub struct IgnoreUnsafeNew;
118 impl IgnoreUnsafeNew {
119 pub unsafe fn new() -> Self {
125 pub struct OptionRefWrapper<'a, T>(Option<&'a T>);
127 impl<'a, T> OptionRefWrapper<'a, T> {
128 pub fn new() -> Self {
129 OptionRefWrapper(None)
133 pub struct Allow(Foo);
136 #[allow(clippy::new_without_default)]
137 pub fn new() -> Self {
142 pub struct AllowDerive;
145 #[allow(clippy::new_without_default)]
146 pub fn new() -> Self {