-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Unhelpful suggestions trying to use array::set #96834
Copy link
Copy link
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
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
setmethod on pin, but it wouldn't do what you expect it to do.