about summary refs log tree commit diff
path: root/tests/ui/inconsistent_struct_constructor.fixed
diff options
context:
space:
mode:
authorYawara ISHIDA <ni732h.sphl@gmail.com>2021-04-20 13:33:39 +0900
committerYawara ISHIDA <ni732h.sphl@gmail.com>2021-04-20 13:34:30 +0900
commit6eae905808fe830a731ed37e3f4a6264ae98e129 (patch)
treed46dd36b0e8ef61f6b8a9d02ace0ef9f5350d0c1 /tests/ui/inconsistent_struct_constructor.fixed
parent61230f4cb822081ee17e8a660bc45a7b6ed0220d (diff)
downloadrust-6eae905808fe830a731ed37e3f4a6264ae98e129.tar.gz
rust-6eae905808fe830a731ed37e3f4a6264ae98e129.zip
Add a test for FP in macro expansion
Diffstat (limited to 'tests/ui/inconsistent_struct_constructor.fixed')
-rw-r--r--tests/ui/inconsistent_struct_constructor.fixed13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/ui/inconsistent_struct_constructor.fixed b/tests/ui/inconsistent_struct_constructor.fixed
index 8d9c3110035..d1025743790 100644
--- a/tests/ui/inconsistent_struct_constructor.fixed
+++ b/tests/ui/inconsistent_struct_constructor.fixed
@@ -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 };