Fix missing note of escaping { for braces including whitespaces#157012
Fix missing note of escaping { for braces including whitespaces#157012Kokoro2336 wants to merge 1 commit into
{ for braces including whitespaces#157012Conversation
|
r? @Kivooeo rustbot has assigned @Kivooeo. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
r? me |
There was a problem hiding this comment.
white_space_only_arg_spaces is a vec but you never access any of its contents, you only ever check whether it is empty or not. So this feels like it is the wrong approach. You also risk emitting it for {} if the format string is something like { } {}.
We track the spans of all arguments already, so you shouldn't need to make any changes to rustc_parse_format. The argument spans are tracked in the position_span fields/variables.
In short, I suggest the following approach:
- Drop all changes to
rustc_parse_format - in
format.rs, if an implicit argument is missing checkposition_spanand if it is non-empty, suggest escaping the braces.
|
Reminder, once the PR becomes ready for a review, use |
efe46af to
e2521e6
Compare
Fixes #156868
Add note of escaping
{for braces including whitespaces