]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/new_without_default.rs
Merge commit '7ea7cd165ad6705603852771bf82cc2fd6560db5' into clippyup2
[rust.git] / 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() {}