Unhelpful suggestions trying to use array::set #96834
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Given the following code:
playground
The current output is:
I don't think suggesting to use Pin here helps users. I tried to use set, since there's also a get so it felt natural to me that set should also exist. It may be a different issue altogether if having no set on arrays is expected, but the error message really bothered me. I tried to do a, what felt to me, trivial operation on an array, and the first suggestion is to Pin it, something which I know is useless. However, unexperienced rust users may not know this. It also doesn't solve the issue. There would be a
set
method on pin, but it wouldn't do what you expect it to do.The text was updated successfully, but these errors were encountered: