Skip to content

Commit

Permalink
Ensure macros are not affected
Browse files Browse the repository at this point in the history
  • Loading branch information
estebank committed Jan 17, 2023
1 parent c847a01 commit 12d18e4
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/ui/parser/fake-anon-enums-in-macros.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// build-pass
macro_rules! check_ty {
($Z:ty) => { compile_error!("triggered"); };
($X:ty | $Y:ty) => { $X };
}

macro_rules! check {
($Z:ty) => { compile_error!("triggered"); };
($X:ty | $Y:ty) => { };
}

check! { i32 | u8 }

fn foo(x: check_ty! { i32 | u8 }) -> check_ty! { i32 | u8 } {
x
}
fn main() {
let x: check_ty! { i32 | u8 } = 42;
let _: check_ty! { i32 | u8 } = foo(x);
}

0 comments on commit 12d18e4

Please sign in to comment.