forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#111133 - hkmatsumoto:handle-python-slicing, r=TaKO8Ki Detect Python-like slicing and suggest how to fix Fix rust-lang#108215
- Loading branch information
Showing
4 changed files
with
53 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// edition:2021 | ||
|
||
fn main() { | ||
&[1, 2, 3][1:2]; | ||
//~^ ERROR: expected one of | ||
//~| HELP: you might have meant a range expression | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
error: expected one of `.`, `?`, `]`, or an operator, found `:` | ||
--> $DIR/range-index-instead-of-colon.rs:4:17 | ||
| | ||
LL | &[1, 2, 3][1:2]; | ||
| ^ expected one of `.`, `?`, `]`, or an operator | ||
| | ||
help: you might have meant a range expression | ||
| | ||
LL | &[1, 2, 3][1..2]; | ||
| ~~ | ||
|
||
error: aborting due to 1 previous error | ||
|