Compiler suggests dereferencing an else block #79736
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.
I tried this code (playground):
I expected to see this happen: The compiler suggests turning
b
into*b
, sincea + 1
is ani32
but b is a&i32
.Instead, this happened:
If you apply the suggestion, you get another compile error:
Applying that suggestion makes it compile, but is much harder to read than just
*b
.Meta
rustc --version
: 1.50.0-nightly (2020-12-03 5be3f9f)The text was updated successfully, but these errors were encountered: