]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/inconsistent_struct_constructor.fixed
Add a test for FP in macro expansion
[rust.git] / tests / ui / inconsistent_struct_constructor.fixed
index 8d9c311003508173c227ebaef88e3d090a9e6ed7..d1025743790a9747bfb95c6bb746d0b1e15b917c 100644 (file)
@@ -13,6 +13,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 +33,10 @@ mod without_base {
         // Should lint.
         Foo { x, y, 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 };