]> git.lizzy.rs Git - rust.git/blobdiff - src/tools/clippy/tests/ui/new_without_default.rs
Merge branch 'master' into hooks
[rust.git] / src / tools / clippy / tests / ui / new_without_default.rs
index 781ea7bb152836eda343116409d8c84406266540..3b6041823d8786672ec6bb3d7bdae19acaeaa428 100644 (file)
@@ -148,4 +148,15 @@ pub fn new() -> Self {
     }
 }
 
+pub struct NewNotEqualToDerive {
+    foo: i32,
+}
+
+impl NewNotEqualToDerive {
+    // This `new` implementation is not equal to a derived `Default`, so do not suggest deriving.
+    pub fn new() -> Self {
+        NewNotEqualToDerive { foo: 1 }
+    }
+}
+
 fn main() {}