@@ -4,35 +4,59 @@ error: expected one of `:` or `@`, found `|`
4
4
LL | fn fun(A | B: E) {}
5
5
| ^ expected one of `:` or `@` here
6
6
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
9
9
|
10
- LL | let ( | A | B);
11
- | ^ expected pattern
10
+ LL | let ( | A | B) = E::A ;
11
+ | ^ help: remove the `|`
12
12
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
15
15
|
16
- LL | let ( | A | B,);
17
- | ^ expected pattern
16
+ LL | let ( | A | B,) = (E::B,) ;
17
+ | ^ help: remove the `|`
18
18
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
21
21
|
22
- LL | let [ | A | B ];
23
- | ^ expected pattern
22
+ LL | let [ | A | B ] = [E::A] ;
23
+ | ^ help: remove the `|`
24
24
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
27
27
|
28
28
LL | let TS( | A | B );
29
- | ^ expected pattern
29
+ | ^ help: remove the `|`
30
30
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
33
33
|
34
34
LL | 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 `||`
36
60
37
61
error: no rules expected the token `|`
38
62
--> $DIR/or-patterns-syntactic-fail.rs:14:15
@@ -70,6 +94,19 @@ LL | let _ = |A | B: E| ();
70
94
|
71
95
= note: an implementation of `std::ops::BitOr` might be missing for `E`
72
96
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
74
110
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