E0308 makes incorrect proposal on range reference, missing parantheses #73553
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-suggestion-diagnostics
Area: Suggestions generated by the compiler applied by `cargo fix`
C-bug
Category: This is a bug.
D-invalid-suggestion
Diagnostics: A structured suggestion resulting in incorrect code.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Hi there!
With this code (here's a playground)
The compiler reports this error message with a hint
but the hint is incorrect due to missing parantheses in this case. The correct answer would be
It works correctly when the second line in main is executed, where the range is provided directly.
Meta
rustc --version --verbose
:This issue has been assigned to @ayazhafiz via this comment.
The text was updated successfully, but these errors were encountered: