diff --git a/compiler/rustc_parse/src/parser/stmt.rs b/compiler/rustc_parse/src/parser/stmt.rs index 391a4777bd94..620ba4a3cb36 100644 --- a/compiler/rustc_parse/src/parser/stmt.rs +++ b/compiler/rustc_parse/src/parser/stmt.rs @@ -578,7 +578,7 @@ impl<'a> Parser<'a> { // this only when parsing an index expression. err.span_suggestion_verbose( self.token.span, - "you might have meant to make a slice with range index", + "you might have meant a range expression", "..", Applicability::MaybeIncorrect, ); diff --git a/tests/ui/suggestions/range-index-instead-of-colon.rs b/tests/ui/suggestions/range-index-instead-of-colon.rs index 0805102de784..3267527ecf2a 100644 --- a/tests/ui/suggestions/range-index-instead-of-colon.rs +++ b/tests/ui/suggestions/range-index-instead-of-colon.rs @@ -3,5 +3,5 @@ fn main() { &[1, 2, 3][1:2]; //~^ ERROR: expected one of - //~| HELP: you might have meant to make a slice with range index + //~| HELP: you might have meant a range expression } diff --git a/tests/ui/suggestions/range-index-instead-of-colon.stderr b/tests/ui/suggestions/range-index-instead-of-colon.stderr index c7a12e9e4fb1..df29356cc16b 100644 --- a/tests/ui/suggestions/range-index-instead-of-colon.stderr +++ b/tests/ui/suggestions/range-index-instead-of-colon.stderr @@ -4,7 +4,7 @@ error: expected one of `.`, `?`, `]`, or an operator, found `:` LL | &[1, 2, 3][1:2]; | ^ 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]; | ~~