summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/needless_lifetimes.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/needless_lifetimes.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/needless_lifetimes.fixed')
-rw-r--r--src/tools/clippy/tests/ui/needless_lifetimes.fixed37
1 files changed, 18 insertions, 19 deletions
diff --git a/src/tools/clippy/tests/ui/needless_lifetimes.fixed b/src/tools/clippy/tests/ui/needless_lifetimes.fixed
index f0f1f9298..e6ead69d1 100644
--- a/src/tools/clippy/tests/ui/needless_lifetimes.fixed
+++ b/src/tools/clippy/tests/ui/needless_lifetimes.fixed
@@ -1,5 +1,5 @@
// run-rustfix
-// aux-build:macro_rules.rs
+// aux-build:proc_macros.rs
#![warn(clippy::needless_lifetimes)]
#![allow(
@@ -12,8 +12,8 @@
clippy::get_first
)]
-#[macro_use]
-extern crate macro_rules;
+extern crate proc_macros;
+use proc_macros::inline_macros;
fn distinct_lifetimes(_x: &u8, _y: &u8, _z: u8) {}
@@ -502,30 +502,29 @@ mod pr_9743_output_lifetime_checks {
}
}
+#[inline_macros]
mod in_macro {
- macro_rules! local_one_input_macro {
- () => {
- fn one_input(x: &u8) -> &u8 {
- unimplemented!()
- }
- };
- }
+ use proc_macros::external;
// lint local macro expands to function with needless lifetimes
- local_one_input_macro!();
+ inline! {
+ fn one_input(x: &u8) -> &u8 {
+ unimplemented!()
+ }
+ }
// no lint on external macro
- macro_rules::needless_lifetime!();
-
- macro_rules! expanded_lifetime {
- ($l:lifetime) => {
- fn f<$l>(arg: &$l str) -> &$l str {
- arg
- }
+ external! {
+ fn needless_lifetime<'a>(x: &'a u8) -> &'a u8 {
+ unimplemented!()
}
}
- expanded_lifetime!('a);
+ inline! {
+ fn f<$'a>(arg: &$'a str) -> &$'a str {
+ arg
+ }
+ }
}
mod issue5787 {