]> git.lizzy.rs Git - rust.git/blob - src/test/ui/lint/issue-47775-nested-macro-unnecessary-parens-arg.rs
Auto merge of #106349 - LeSeulArtichaut:dyn-star-tracking-issue, r=jackh726
[rust.git] / src / test / ui / lint / issue-47775-nested-macro-unnecessary-parens-arg.rs
1 // check-pass
2
3 #![warn(unused_parens)]
4
5 macro_rules! the_worship_the_heart_lifts_above {
6     ( @as_expr, $e:expr) => { $e };
7     ( @generate_fn, $name:tt) => {
8         #[allow(dead_code)] fn the_moth_for_the_star<'a>() -> Option<&'a str> {
9             Some(the_worship_the_heart_lifts_above!( @as_expr, $name ))
10         }
11     };
12     ( $name:ident ) => { the_worship_the_heart_lifts_above!( @generate_fn, (stringify!($name))); }
13     // ↑ Notably, this does 𝘯𝘰𝘵 warn: we're declining to lint unused parens in
14     // function/method arguments inside of nested macros because of situations
15     // like those reported in Issue #47775
16 }
17
18 macro_rules! and_the_heavens_reject_not {
19     () => {
20         #[allow(dead_code)] fn the_night_for_the_morrow() -> Option<isize> { Some((2)) }
21     }
22 }
23
24 the_worship_the_heart_lifts_above!(rah);
25 and_the_heavens_reject_not!();
26
27 fn main() {}