]> git.proxmox.com Git - rustc.git/blame - src/test/ui/lint/issue-47775-nested-macro-unnecessary-parens-arg.rs
New upstream version 1.41.1+dfsg1
[rustc.git] / src / test / ui / lint / issue-47775-nested-macro-unnecessary-parens-arg.rs
CommitLineData
60c5eb7d 1// check-pass
2c00a5a8
XL
2
3#![warn(unused_parens)]
4
5macro_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
18macro_rules! and_the_heavens_reject_not {
19 () => {
2c00a5a8 20 #[allow(dead_code)] fn the_night_for_the_morrow() -> Option<isize> { Some((2)) }
2c00a5a8
XL
21 }
22}
23
24the_worship_the_heart_lifts_above!(rah);
25and_the_heavens_reject_not!();
26
27fn main() {}