-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`Area: Suggestions generated by the compiler applied by `cargo fix`C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.
Description
When encountering curly quotes, the compiler now points at the opening one suggesting changing it for a regular straight quote. It should also look ahead looking for a closing curly quote char and suggest changing that one too, because when fixing only the first one, the parser will interpret this as an unclosed string.
fn main() {
println!(“”);
}
error: unknown start of token: \u{201c}
--> src/main.rs:2:14
|
2 | println!(“”);
| ^
help: Unicode character '“' (Left Double Quotation Mark) looks like '"' (Quotation Mark), but it is not
|
2 | println!("”);
| ^
After applying suggestion:
error: unterminated double quote string
--> src/main.rs:2:14
|
2 | println!("”);
| ______________^
3 | | }
| |_^
Ideally
error: unknown start of token: \u{201c}
--> src/main.rs:2:14
|
2 | println!(“”);
| ^-
help: Unicode character '“' (Left Double Quotation Mark) and '”' (Right Double Quotation Mark) look like '"' (Quotation Mark), but it are not
|
2 | println!("");
| ^^
Metadata
Metadata
Assignees
Labels
A-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`Area: Suggestions generated by the compiler applied by `cargo fix`C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.