diff options
| author | bors <bors@rust-lang.org> | 2021-04-20 08:26:21 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-04-20 08:26:21 +0000 |
| commit | ec38ea1ac1eac8efad1880fe33c49d65b8c4591c (patch) | |
| tree | 56575e2583edf3c13765e4a059693ce9fb00d24c /tests/ui/inconsistent_struct_constructor.fixed | |
| parent | b7c12f3aab940cf3b75a1e195989c0722f9ffe46 (diff) | |
| parent | 6eae905808fe830a731ed37e3f4a6264ae98e129 (diff) | |
| download | rust-ec38ea1ac1eac8efad1880fe33c49d65b8c4591c.tar.gz rust-ec38ea1ac1eac8efad1880fe33c49d65b8c4591c.zip | |
Auto merge of #7097 - yawara:fix/7069, r=llogiq
Fixed inconsistent_struct_constructor triggers in macro-generated code fixes #7069 changelog: `inconsistent_struct_constructor`: Fix FP in macro expansion.
Diffstat (limited to 'tests/ui/inconsistent_struct_constructor.fixed')
| -rw-r--r-- | tests/ui/inconsistent_struct_constructor.fixed | 13 |
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 }; |
