1- error: expected one of `@` or `| `, found `: `
2- --> $DIR/type-ascription-in-pattern.rs:3:10
1+ error: expected one of `!`, `,`, `. `, `::`, `?`, `{`, `}`, or an operator, found `=> `
2+ --> $DIR/type-ascription-in-pattern.rs:3:16
33 |
4+ LL | match x {
5+ | - while parsing this struct
46LL | x: i32 => x,
5- | ^ --- specifying the type of a pattern isn't supported
6- | |
7- | expected one of `@` or `|`
7+ | -^^ expected one of 8 possible tokens
8+ | |
9+ | help: try adding a comma: `,`
10+
11+ error: expected identifier, found keyword `true`
12+ --> $DIR/type-ascription-in-pattern.rs:4:9
813 |
9- help: maybe write a path separator here
14+ LL | match x {
15+ | - while parsing this struct
16+ LL | x: i32 => x,
17+ LL | true => 42.,
18+ | ^^^^ expected identifier, found keyword
19+
20+ error: expected identifier, found keyword `false`
21+ --> $DIR/type-ascription-in-pattern.rs:5:9
1022 |
11- LL | x::i32 => x,
12- | ~~
23+ LL | match x {
24+ | - while parsing this struct
25+ ...
26+ LL | false => 0.333,
27+ | ^^^^^ expected identifier, found keyword
28+
29+ error: struct literals are not allowed here
30+ --> $DIR/type-ascription-in-pattern.rs:2:11
31+ |
32+ LL | match x {
33+ | ___________^
34+ LL | | x: i32 => x,
35+ LL | | true => 42.,
36+ LL | | false => 0.333,
37+ LL | | }
38+ | |_____^
39+ |
40+ help: surround the struct literal with parentheses
41+ |
42+ LL ~ match (x {
43+ LL | x: i32 => x,
44+ LL | true => 42.,
45+ LL | false => 0.333,
46+ LL ~ })
47+ |
48+
49+ error: expected one of `.`, `?`, `{`, or an operator, found `}`
50+ --> $DIR/type-ascription-in-pattern.rs:7:1
51+ |
52+ LL | match x {
53+ | ----- while parsing this `match` expression
54+ ...
55+ LL | }
56+ | - expected one of `.`, `?`, `{`, or an operator
57+ LL | }
58+ | ^ unexpected token
1359
1460error: expected one of `...`, `..=`, `..`, or `|`, found `:`
15- --> $DIR/type-ascription-in-pattern.rs:12 :11
61+ --> $DIR/type-ascription-in-pattern.rs:11 :11
1662 |
1763LL | 42: i32 => (),
1864 | ^ --- specifying the type of a pattern isn't supported
1965 | |
2066 | expected one of `...`, `..=`, `..`, or `|`
2167
2268error: expected `|`, found `:`
23- --> $DIR/type-ascription-in-pattern.rs:13 :10
69+ --> $DIR/type-ascription-in-pattern.rs:12 :10
2470 |
2571LL | _: f64 => (),
2672 | ^ --- specifying the type of a pattern isn't supported
2773 | |
2874 | expected `|`
2975
3076error: expected one of `@` or `|`, found `:`
31- --> $DIR/type-ascription-in-pattern.rs:14 :10
77+ --> $DIR/type-ascription-in-pattern.rs:13 :10
3278 |
3379LL | x: i32 => (),
3480 | ^ --- specifying the type of a pattern isn't supported
@@ -40,15 +86,5 @@ help: maybe write a path separator here
4086LL | x::i32 => (),
4187 | ~~
4288
43- error[E0308]: mismatched types
44- --> $DIR/type-ascription-in-pattern.rs:3:19
45- |
46- LL | fn foo(x: bool) -> i32 {
47- | --- expected `i32` because of return type
48- LL | match x {
49- LL | x: i32 => x,
50- | ^ expected `i32`, found `bool`
51-
52- error: aborting due to 5 previous errors
89+ error: aborting due to 8 previous errors
5390
54- For more information about this error, try `rustc --explain E0308`.
0 commit comments