Wrong position of inserted &self
in suggestion of compile error
#91783
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:
I expected to see this happen: Correct compile error due to lack of
self
receiver.Instead, this happened: Compile error happens. But its suggestion is not correct:
&self
is inserted to just after first(
. But in this case, the first(
is not for method parameter. So the position is not correct.This line should be:
Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: