Suggest using single quotes when confusing single character strings and chars #92479
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Consider the following example:
The compiler could be more friendly in this case, having a diagnostic for suggesting using single quotes when people confuse single character strings with char literals. Something like this:
This could help new Rust devs coming from languages where there are no distinction between these things. (Python, Javascript, etc.)
The text was updated successfully, but these errors were encountered: