]> git.lizzy.rs Git - rust.git/blob - tests/ui/parser/anon-enums-are-ambiguous.rs
Rollup merge of #107559 - WaffleLapkin:is_it_2015¿, r=davidtwco
[rust.git] / tests / ui / parser / anon-enums-are-ambiguous.rs
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 }