Skip to content

Commit 0ab8430

Browse files
committed
parser: reword || recovery.
1 parent e374772 commit 0ab8430

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/libsyntax/parse/parser/pat.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ impl<'a> Parser<'a> {
119119
self.struct_span_err(self.token.span, "unexpected token `||` after pattern")
120120
.span_suggestion(
121121
self.token.span,
122-
"use a single `|` to specify multiple patterns",
122+
"use a single `|` to separate multiple alternative patterns",
123123
"|".to_owned(),
124124
Applicability::MachineApplicable
125125
)

src/test/ui/or-patterns/multiple-pattern-typo.stderr

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,43 +2,43 @@ error: unexpected token `||` after pattern
22
--> $DIR/multiple-pattern-typo.rs:8:15
33
|
44
LL | 1 | 2 || 3 => (),
5-
| ^^ help: use a single `|` to specify multiple patterns: `|`
5+
| ^^ help: use a single `|` to separate multiple alternative patterns: `|`
66

77
error: unexpected token `||` after pattern
88
--> $DIR/multiple-pattern-typo.rs:13:16
99
|
1010
LL | (1 | 2 || 3) => (),
11-
| ^^ help: use a single `|` to specify multiple patterns: `|`
11+
| ^^ help: use a single `|` to separate multiple alternative patterns: `|`
1212

1313
error: unexpected token `||` after pattern
1414
--> $DIR/multiple-pattern-typo.rs:18:16
1515
|
1616
LL | (1 | 2 || 3,) => (),
17-
| ^^ help: use a single `|` to specify multiple patterns: `|`
17+
| ^^ help: use a single `|` to separate multiple alternative patterns: `|`
1818

1919
error: unexpected token `||` after pattern
2020
--> $DIR/multiple-pattern-typo.rs:25:18
2121
|
2222
LL | TS(1 | 2 || 3) => (),
23-
| ^^ help: use a single `|` to specify multiple patterns: `|`
23+
| ^^ help: use a single `|` to separate multiple alternative patterns: `|`
2424

2525
error: unexpected token `||` after pattern
2626
--> $DIR/multiple-pattern-typo.rs:32:23
2727
|
2828
LL | NS { f: 1 | 2 || 3 } => (),
29-
| ^^ help: use a single `|` to specify multiple patterns: `|`
29+
| ^^ help: use a single `|` to separate multiple alternative patterns: `|`
3030

3131
error: unexpected token `||` after pattern
3232
--> $DIR/multiple-pattern-typo.rs:37:16
3333
|
3434
LL | [1 | 2 || 3] => (),
35-
| ^^ help: use a single `|` to specify multiple patterns: `|`
35+
| ^^ help: use a single `|` to separate multiple alternative patterns: `|`
3636

3737
error: unexpected token `||` after pattern
3838
--> $DIR/multiple-pattern-typo.rs:42:9
3939
|
4040
LL | || 1 | 2 | 3 => (),
41-
| ^^ help: use a single `|` to specify multiple patterns: `|`
41+
| ^^ help: use a single `|` to separate multiple alternative patterns: `|`
4242

4343
warning: the feature `or_patterns` is incomplete and may cause the compiler to crash
4444
--> $DIR/multiple-pattern-typo.rs:1:12

0 commit comments

Comments
 (0)