summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/toplevel_ref_arg_non_rustfix.rs
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_non_rustfix.rs
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_non_rustfix.rs')
-rw-r--r--src/tools/clippy/tests/ui/toplevel_ref_arg_non_rustfix.rs22
1 files changed, 8 insertions, 14 deletions
diff --git a/src/tools/clippy/tests/ui/toplevel_ref_arg_non_rustfix.rs b/src/tools/clippy/tests/ui/toplevel_ref_arg_non_rustfix.rs
index 1a493fbce..2047593e7 100644
--- a/src/tools/clippy/tests/ui/toplevel_ref_arg_non_rustfix.rs
+++ b/src/tools/clippy/tests/ui/toplevel_ref_arg_non_rustfix.rs
@@ -1,33 +1,27 @@
-// aux-build:macro_rules.rs
+// aux-build:proc_macros.rs
#![warn(clippy::toplevel_ref_arg)]
#![allow(unused)]
-#[macro_use]
-extern crate macro_rules;
+extern crate proc_macros;
+use proc_macros::{external, inline_macros};
fn the_answer(ref mut x: u8) {
*x = 42;
}
-macro_rules! gen_function {
- () => {
- fn fun_example(ref _x: usize) {}
- };
-}
-
+#[inline_macros]
fn main() {
let mut x = 0;
the_answer(x);
// lint in macro
- #[allow(unused)]
- {
- gen_function!();
+ inline! {
+ fn fun_example(ref _x: usize) {}
}
// do not lint in external macro
- {
- ref_arg_function!();
+ external! {
+ fn fun_example2(ref _x: usize) {}
}
}