Skip to content

Commit acec70d

Browse files
committed
Change help message to make some sense in broader context
1 parent 730d299 commit acec70d

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

compiler/rustc_parse/src/parser/stmt.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ impl<'a> Parser<'a> {
578578
// this only when parsing an index expression.
579579
err.span_suggestion_verbose(
580580
self.token.span,
581-
"you might have meant to make a slice with range index",
581+
"you might have meant a range expression",
582582
"..",
583583
Applicability::MaybeIncorrect,
584584
);

tests/ui/suggestions/range-index-instead-of-colon.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
fn main() {
44
&[1, 2, 3][1:2];
55
//~^ ERROR: expected one of
6-
//~| HELP: you might have meant to make a slice with range index
6+
//~| HELP: you might have meant a range expression
77
}

tests/ui/suggestions/range-index-instead-of-colon.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: expected one of `.`, `?`, `]`, or an operator, found `:`
44
LL | &[1, 2, 3][1:2];
55
| ^ expected one of `.`, `?`, `]`, or an operator
66
|
7-
help: you might have meant to make a slice with range index
7+
help: you might have meant a range expression
88
|
99
LL | &[1, 2, 3][1..2];
1010
| ~~

0 commit comments

Comments
 (0)