@@ -4,35 +4,59 @@ error: expected one of `:` or `@`, found `|`
44LL | fn fun(A | B: E) {}
55 | ^ expected one of `:` or `@` here
66
7- error: expected pattern, found `|`
8- --> $DIR/or-patterns-syntactic-fail.rs:35 :11
7+ error: a leading `|` is only allowed in a top-level pattern
8+ --> $DIR/or-patterns-syntactic-fail.rs:37 :11
99 |
10- LL | let ( | A | B);
11- | ^ expected pattern
10+ LL | let ( | A | B) = E::A ;
11+ | ^ help: remove the `|`
1212
13- error: expected pattern, found `|`
14- --> $DIR/or-patterns-syntactic-fail.rs:40 :11
13+ error: a leading `|` is only allowed in a top-level pattern
14+ --> $DIR/or-patterns-syntactic-fail.rs:38 :11
1515 |
16- LL | let ( | A | B,);
17- | ^ expected pattern
16+ LL | let ( | A | B,) = (E::B,) ;
17+ | ^ help: remove the `|`
1818
19- error: expected pattern, found `|`
20- --> $DIR/or-patterns-syntactic-fail.rs:45 :11
19+ error: a leading `|` is only allowed in a top-level pattern
20+ --> $DIR/or-patterns-syntactic-fail.rs:39 :11
2121 |
22- LL | let [ | A | B ];
23- | ^ expected pattern
22+ LL | let [ | A | B ] = [E::A] ;
23+ | ^ help: remove the `|`
2424
25- error: expected pattern, found `|`
26- --> $DIR/or-patterns-syntactic-fail.rs:50 :13
25+ error: a leading `|` is only allowed in a top-level pattern
26+ --> $DIR/or-patterns-syntactic-fail.rs:40 :13
2727 |
2828LL | let TS( | A | B );
29- | ^ expected pattern
29+ | ^ help: remove the `|`
3030
31- error: expected pattern, found `|`
32- --> $DIR/or-patterns-syntactic-fail.rs:55 :17
31+ error: a leading `|` is only allowed in a top-level pattern
32+ --> $DIR/or-patterns-syntactic-fail.rs:41 :17
3333 |
3434LL | let NS { f: | A | B };
35- | ^ expected pattern
35+ | ^ help: remove the `|`
36+
37+ error: a leading `|` is only allowed in a top-level pattern
38+ --> $DIR/or-patterns-syntactic-fail.rs:43:11
39+ |
40+ LL | let ( || A | B) = E::A;
41+ | ^^ help: remove the `||`
42+
43+ error: a leading `|` is only allowed in a top-level pattern
44+ --> $DIR/or-patterns-syntactic-fail.rs:44:11
45+ |
46+ LL | let [ || A | B ] = [E::A];
47+ | ^^ help: remove the `||`
48+
49+ error: a leading `|` is only allowed in a top-level pattern
50+ --> $DIR/or-patterns-syntactic-fail.rs:45:13
51+ |
52+ LL | let TS( || A | B );
53+ | ^^ help: remove the `||`
54+
55+ error: a leading `|` is only allowed in a top-level pattern
56+ --> $DIR/or-patterns-syntactic-fail.rs:46:17
57+ |
58+ LL | let NS { f: || A | B };
59+ | ^^ help: remove the `||`
3660
3761error: no rules expected the token `|`
3862 --> $DIR/or-patterns-syntactic-fail.rs:14:15
@@ -70,6 +94,19 @@ LL | let _ = |A | B: E| ();
7094 |
7195 = note: an implementation of `std::ops::BitOr` might be missing for `E`
7296
73- error: aborting due to 9 previous errors
97+ error[E0308]: mismatched types
98+ --> $DIR/or-patterns-syntactic-fail.rs:48:36
99+ |
100+ LL | let recovery_witness: String = 0;
101+ | ^
102+ | |
103+ | expected struct `std::string::String`, found integer
104+ | help: try using a conversion method: `0.to_string()`
105+ |
106+ = note: expected type `std::string::String`
107+ found type `{integer}`
108+
109+ error: aborting due to 14 previous errors
74110
75- For more information about this error, try `rustc --explain E0369`.
111+ Some errors have detailed explanations: E0308, E0369.
112+ For more information about an error, try `rustc --explain E0308`.
0 commit comments