summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/inconsistent_struct_constructor.fixed
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:20:39 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:20:39 +0000
commit1376c5a617be5c25655d0d7cb63e3beaa5a6e026 (patch)
tree3bb8d61aee02bc7a15eab3f36e3b921afc2075d0 /src/tools/clippy/tests/ui/inconsistent_struct_constructor.fixed
parentReleasing progress-linux version 1.69.0+dfsg1-1~progress7.99u1. (diff)
downloadrustc-1376c5a617be5c25655d0d7cb63e3beaa5a6e026.tar.xz
rustc-1376c5a617be5c25655d0d7cb63e3beaa5a6e026.zip
Merging upstream version 1.70.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/tools/clippy/tests/ui/inconsistent_struct_constructor.fixed')
-rw-r--r--src/tools/clippy/tests/ui/inconsistent_struct_constructor.fixed21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/tools/clippy/tests/ui/inconsistent_struct_constructor.fixed b/src/tools/clippy/tests/ui/inconsistent_struct_constructor.fixed
index 74ba2f1c5..5aaa00f85 100644
--- a/src/tools/clippy/tests/ui/inconsistent_struct_constructor.fixed
+++ b/src/tools/clippy/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 };