-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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 #92460 - dwrensha:fix-92267, r=petrochenkov
[rustc_builtin_macros] add indices to format_foreign::printf::Substitution::Escape Fixes #92267. The problem was that the escape string "%%" does not need to appear at the very beginning of the format string, but the iterator implementation assumed that it did. The solution follows the pattern used by `format_foregin::shell::Subtitution::Escape`: https://github.com/rust-lang/rust/blob/8ed935e92dfb09ae388344b12284bf5110cf9265/compiler/rustc_builtin_macros/src/format_foreign.rs#L629
- Loading branch information
Showing
4 changed files
with
34 additions
and
19 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,3 @@ | ||
// check-fail | ||
|
||
pub fn main() { println!("🦀%%%", 0) } //~ ERROR argument never used |
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,16 @@ | ||
error: argument never used | ||
--> $DIR/issue-92267.rs:3:34 | ||
| | ||
LL | pub fn main() { println!("🦀%%%", 0) } | ||
| ^ argument never used | ||
| | ||
note: format specifiers use curly braces, and the conversion specifier ` | ||
` is unknown or unsupported | ||
--> $DIR/issue-92267.rs:3:30 | ||
| | ||
LL | pub fn main() { println!("🦀%%%", 0) } | ||
| ^^ | ||
= note: printf formatting not supported; see the documentation for `std::fmt` | ||
|
||
error: aborting due to previous error | ||
|