Change help message to make some sense in broader context
This commit is contained in:
parent
730d299354
commit
acec70de9b
3 changed files with 3 additions and 3 deletions
|
@ -578,7 +578,7 @@ impl<'a> Parser<'a> {
|
||||||
// this only when parsing an index expression.
|
// this only when parsing an index expression.
|
||||||
err.span_suggestion_verbose(
|
err.span_suggestion_verbose(
|
||||||
self.token.span,
|
self.token.span,
|
||||||
"you might have meant to make a slice with range index",
|
"you might have meant a range expression",
|
||||||
"..",
|
"..",
|
||||||
Applicability::MaybeIncorrect,
|
Applicability::MaybeIncorrect,
|
||||||
);
|
);
|
||||||
|
|
|
@ -3,5 +3,5 @@
|
||||||
fn main() {
|
fn main() {
|
||||||
&[1, 2, 3][1:2];
|
&[1, 2, 3][1:2];
|
||||||
//~^ ERROR: expected one of
|
//~^ ERROR: expected one of
|
||||||
//~| HELP: you might have meant to make a slice with range index
|
//~| HELP: you might have meant a range expression
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@ error: expected one of `.`, `?`, `]`, or an operator, found `:`
|
||||||
LL | &[1, 2, 3][1:2];
|
LL | &[1, 2, 3][1:2];
|
||||||
| ^ expected one of `.`, `?`, `]`, or an operator
|
| ^ expected one of `.`, `?`, `]`, or an operator
|
||||||
|
|
|
|
||||||
help: you might have meant to make a slice with range index
|
help: you might have meant a range expression
|
||||||
|
|
|
|
||||||
LL | &[1, 2, 3][1..2];
|
LL | &[1, 2, 3][1..2];
|
||||||
| ~~
|
| ~~
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue