From 6eae905808fe830a731ed37e3f4a6264ae98e129 Mon Sep 17 00:00:00 2001 From: Yawara ISHIDA Date: Tue, 20 Apr 2021 13:33:39 +0900 Subject: Add a test for FP in macro expansion --- tests/ui/inconsistent_struct_constructor.fixed | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'tests/ui/inconsistent_struct_constructor.fixed') 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 }; -- cgit 1.4.1-3-g733a5