5 fn get_usize() -> usize {
9 macro_rules! force_expr {
13 macro_rules! force_pat {
14 ($a:expr, $b:expr) => { $a..=$b }
17 macro_rules! make_vec {
18 () => { force_expr!(Vec::new()) } //~ ERROR arbitrary expressions aren't allowed
21 macro_rules! make_pat {
22 () => { force_pat!(get_usize(), get_usize()) }
23 //~^ ERROR arbitrary expressions aren't allowed
24 //~| ERROR arbitrary expressions aren't allowed
27 #[allow(unreachable_code)]
28 fn f() -> Result<(), impl core::fmt::Debug> {
31 assert!(matches!(x, En::A(make_vec!())));
32 assert!(matches!(5, make_pat!()));
33 Ok::<(), &'static str>(())