Skip to content

Commit 39db65c

Browse files
Add a test
1 parent e4b2936 commit 39db65c

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// check-pass
2+
3+
macro_rules! test_expr {
4+
($expr:expr) => {};
5+
}
6+
7+
macro_rules! test_ty {
8+
($a:ty | $b:ty) => {};
9+
}
10+
11+
fn main() {
12+
test_expr!(a as fn() -> B | C);
13+
// Do not break the `|` operator.
14+
15+
test_expr!(|_: fn() -> B| C | D);
16+
// Do not break `-> Ret` in closure args.
17+
18+
test_ty!(A | B);
19+
// We can't support anon enums in arbitrary positions.
20+
21+
test_ty!(fn() -> A | B);
22+
// Don't break fn ptrs.
23+
24+
test_ty!(impl Fn() -> A | B);
25+
// Don't break parenthesized generics.
26+
}

0 commit comments

Comments
 (0)