]> git.lizzy.rs Git - rust.git/blob - tests/ui/proc-macro/nodelim-groups.rs
Rollup merge of #105172 - alexs-sh:issue-98861-fix-next, r=scottmcm
[rust.git] / tests / ui / proc-macro / nodelim-groups.rs
1 // run-pass
2 // aux-build:test-macros.rs
3 // compile-flags: -Z span-debug
4 // edition:2018
5 //
6 // Tests the pretty-printing behavior of inserting `Invisible`-delimited groups
7
8 #![no_std] // Don't load unnecessary hygiene information from std
9 extern crate std;
10
11 extern crate test_macros;
12 use test_macros::print_bang_consume;
13
14 macro_rules! expand_it {
15     (($val1:expr) ($val2:expr)) => { expand_it!($val1 + $val2) };
16     ($val:expr) => { print_bang_consume!("hi" $val (1 + 1)) };
17 }
18
19 fn main() {
20     expand_it!(1 + (25) + 1);
21     expand_it!(("hello".len()) ("world".len()));
22 }