summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/inconsistent_struct_constructor.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/clippy/tests/ui/inconsistent_struct_constructor.rs')
-rw-r--r--src/tools/clippy/tests/ui/inconsistent_struct_constructor.rs21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/tools/clippy/tests/ui/inconsistent_struct_constructor.rs b/src/tools/clippy/tests/ui/inconsistent_struct_constructor.rs
index ba96e1e33..2b2dd7f59 100644
--- a/src/tools/clippy/tests/ui/inconsistent_struct_constructor.rs
+++ b/src/tools/clippy/tests/ui/inconsistent_struct_constructor.rs
@@ -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 };