-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rustc_parse_format: Fix character indices in find_skips
Fixes #81006
- Loading branch information
Showing
3 changed files
with
25 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// check-fail | ||
|
||
// First format below would cause a panic, second would generate error with incorrect span | ||
|
||
fn main() { | ||
let _ = format!("→{}→\n"); | ||
//~^ ERROR 1 positional argument in format string, but no arguments were given | ||
let _ = format!("→{} \n"); | ||
//~^ ERROR 1 positional argument in format string, but no arguments were given | ||
} |
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,14 @@ | ||
error: 1 positional argument in format string, but no arguments were given | ||
--> $DIR/issue-81006.rs:6:23 | ||
| | ||
LL | let _ = format!("→{}→\n"); | ||
| ^^ | ||
|
||
error: 1 positional argument in format string, but no arguments were given | ||
--> $DIR/issue-81006.rs:8:23 | ||
| | ||
LL | let _ = format!("→{} \n"); | ||
| ^^ | ||
|
||
error: aborting due to 2 previous errors | ||
|