diff options
| author | Philipp Krones <hello@philkrones.com> | 2023-03-24 14:04:35 +0100 |
|---|---|---|
| committer | Philipp Krones <hello@philkrones.com> | 2023-03-24 14:26:19 +0100 |
| commit | 8df896c076fd993bad58878ee8a6ed29d8e586ba (patch) | |
| tree | c0edd67687a954bb38d66e77dae3dbd0db3909c5 /tests/ui/inconsistent_struct_constructor.fixed | |
| parent | 58eb9964cc627470cdd9fdcdef872a45615227fe (diff) | |
| download | rust-8df896c076fd993bad58878ee8a6ed29d8e586ba.tar.gz rust-8df896c076fd993bad58878ee8a6ed29d8e586ba.zip | |
Merge commit 'd5e2a7aca55ed49fc943b7a07a8eba05ab5a0079' into clippyup
Diffstat (limited to 'tests/ui/inconsistent_struct_constructor.fixed')
| -rw-r--r-- | tests/ui/inconsistent_struct_constructor.fixed | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/tests/ui/inconsistent_struct_constructor.fixed b/tests/ui/inconsistent_struct_constructor.fixed index 74ba2f1c5e7..5aaa00f8517 100644 --- a/tests/ui/inconsistent_struct_constructor.fixed +++ b/tests/ui/inconsistent_struct_constructor.fixed @@ -1,10 +1,14 @@ // run-rustfix +// aux-build:proc_macros.rs + #![warn(clippy::inconsistent_struct_constructor)] #![allow(clippy::redundant_field_names)] #![allow(clippy::unnecessary_operation)] #![allow(clippy::no_effect)] #![allow(dead_code)] +extern crate proc_macros; + #[derive(Default)] struct Foo { x: i32, @@ -12,18 +16,10 @@ 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; + #[proc_macros::inline_macros] fn test() { let x = 1; let y = 1; @@ -34,7 +30,12 @@ mod without_base { // Should NOT lint. // issue #7069. - new_foo!(); + inline!({ + let x = 1; + let y = 1; + let z = 1; + Foo { y, x, z } + }); // Should NOT lint because the order is the same as in the definition. Foo { x, y, z }; |
