Compiler suggests writing &mut mut foo
in E0277 with .as_slice()
#105645
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
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:
Notice that the suggestion is to write
foo(&mut mut bref)
, which is both invalid syntax and not where the problem is located —as_slice()
returns an&
reference, so that call must be changed and no local syntax change can work.Occurs on stable 1.65.0 and 1.68.0-nightly (2022-12-11 bdb07a8)
The text was updated successfully, but these errors were encountered: