]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/inconsistent_struct_constructor.rs
Auto merge of #8374 - Alexendoo:bless-revisions, r=camsteffen
[rust.git] / tests / ui / inconsistent_struct_constructor.rs
index 63fac9105015d3756b5be6edc83c52777c5d5179..5caadc7c62083fb2b214df04ded3b16e2bb665f7 100644 (file)
@@ -1,5 +1,4 @@
 // run-rustfix
-// edition:2018
 #![warn(clippy::inconsistent_struct_constructor)]
 #![allow(clippy::redundant_field_names)]
 #![allow(clippy::unnecessary_operation)]
@@ -13,6 +12,15 @@ struct Foo {
     z: i32,
 }
 
+macro_rules! new_foo {
+    () => {
+        let x = 1;
+        let y = 1;
+        let z = 1;
+        Foo { y, x, z }
+    };
+}
+
 mod without_base {
     use super::Foo;
 
@@ -24,6 +32,10 @@ fn test() {
         // Should lint.
         Foo { y, x, z };
 
+        // Should NOT lint.
+        // issue #7069.
+        new_foo!();
+
         // Shoule NOT lint because the order is the same as in the definition.
         Foo { x, y, z };