We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e4b2936 commit 39db65cCopy full SHA for 39db65c
tests/ui/parser/anon-enums-are-ambiguous.rs
@@ -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