-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add error explanation for E0502 #33353
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @GuillaumeGomez (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
} | ||
``` | ||
|
||
You may want the value before any changes are applied. In that case, you can |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra whitespace.
I think it's not completely well explained. For example, you say that if you want the value before modifying it, you can just copy it. But it's absolutely wrong in many cases (in every case where the type doesn't implement So in conclusion, could you make the explanation simpler please? Something like "please check you don't have any other reference to your variable before trying to get a mutable access to it", followed by an example. |
Sure thing. Thanks for the critique. I was worried about the |
I think they're not helpful. However, providing an url to the rust book was an excellent idea. |
I have simplified the explanation. |
Do you want me to squash the previous commit? Also, there will be a merge conflict with my changes on #33294. Is there anything that I need to do about that? |
Oh right, I didn't pay attention to commits. Please squash them. Thanks for notifying me about it. For the conflict that'll occur, the only choice is to wait that one of the two PRs is merged before fixing the conflict and then merge the other one. |
@steveklabnik Phasers set to merge. |
☔ The latest upstream changes (presumably #33376) made this pull request unmergeable. Please resolve the merge conflicts. |
@timothy-mcroy: You need to update your PR. |
Ah, yeah. Thanks for the reminder. Finals week. :/ |
@@ -454,6 +454,38 @@ fn foo(a: &mut i32) { | |||
``` | |||
"##, | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra empty line.
Two nits to fixed and it's good to get merged! (good luck for your finals!) |
Nits are fixed. Thanks! |
Thanks! r=me @steveklabnik |
☔ The latest upstream changes (presumably #33658) made this pull request unmergeable. Please resolve the merge conflicts. |
Oh bors. Why must you be so angry with me? I'll get this updated. |
Ready to roll. @steveklabnik |
@bors: r+ rollup |
📌 Commit bbb7844 has been approved by |
Add error explanation for E0502 I am questioning the order of presentation on the suggested code fixes, but I'm not sure what would be best. Thoughts? r? @GuillaumeGomez
@bors r- This failed Travis. When you add error explanation, you need to remove the error from the list at the end of the file. See 7a9f4c2 for an example. |
Gahhh, how did I forget that that time. Embarrassing. :/ |
@bors r+ rollup |
📌 Commit acfe199 has been approved by |
Add error explanation for E0502 I am questioning the order of presentation on the suggested code fixes, but I'm not sure what would be best. Thoughts? r? @GuillaumeGomez
I am questioning the order of presentation on the suggested code fixes, but I'm not sure what would be best. Thoughts?
#32777
r? @GuillaumeGomez