summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/toplevel_ref_arg.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/toplevel_ref_arg.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/toplevel_ref_arg.fixed')
-rw-r--r--src/tools/clippy/tests/ui/toplevel_ref_arg.fixed24
1 files changed, 7 insertions, 17 deletions
diff --git a/src/tools/clippy/tests/ui/toplevel_ref_arg.fixed b/src/tools/clippy/tests/ui/toplevel_ref_arg.fixed
index 09fb66ca3..174c858a4 100644
--- a/src/tools/clippy/tests/ui/toplevel_ref_arg.fixed
+++ b/src/tools/clippy/tests/ui/toplevel_ref_arg.fixed
@@ -1,17 +1,12 @@
// run-rustfix
-// aux-build:macro_rules.rs
+// aux-build:proc_macros.rs
#![warn(clippy::toplevel_ref_arg)]
-#![allow(clippy::uninlined_format_args)]
+#![allow(clippy::uninlined_format_args, unused)]
-#[macro_use]
-extern crate macro_rules;
-
-macro_rules! gen_binding {
- () => {
- let _y = &42;
- };
-}
+extern crate proc_macros;
+use proc_macros::{external, inline_macros};
+#[inline_macros]
fn main() {
// Closures should not warn
let y = |ref x| println!("{:?}", x);
@@ -38,13 +33,8 @@ fn main() {
for ref _x in 0..10 {}
// lint in macro
- #[allow(unused)]
- {
- gen_binding!();
- }
+ inline!(let _y = &42;);
// do not lint in external macro
- {
- ref_arg_binding!();
- }
+ external!(let ref _y = 42;);
}