Error message for trying to bind range of units to unit suggests invalid code #93122
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
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.
Given the following code:
The current output is:
Blindly applying all the suggestions would lead to:
...which is obviously syntactically invalid.
Ideally the output should account for required parenthesis and look like:
This issue is reproducible on stable versions from 1.51.0 to 1.58.0, latest beta (
rustc 1.59.0-beta.1 (7c0b25092 2022-01-13)
) and latest nightly (rustc 1.60.0-nightly (9ad5d82f8 2022-01-18)
) at the moment.Some other things about this bug
The text was updated successfully, but these errors were encountered: