-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Fix ICE when nameless borrowed binding is dropped #47869
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
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @michaelwoerister (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. |
Thanks for the PR! We’ll periodically check in on it to make sure that @michaelwoerister or someone else from the team reviews it soon. |
@michaelwoerister ping from triage! This PR needs a review. |
r? @Zoxc |
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.
So, the PR seems fine, but I wonder if we can do better with the error message. I had to resort to reading the MIR to better understand what is happening here.
For those curious: the variableborrow
is being moved into the tuple, and the tuple is then dropped (not borrow
).
I think what I would want is maybe something like:
|
We could produce that, I suppose, by
If there are multiple assignments, maybe we give up, and just say "borrow may be used when a temporary value is dropped here" or something. |
@nickfrostatx what do you think? =) You be up for that? |
@nikomatsakis Sure, that would be a much more helpful message. I'll try to get that working. |
Hi @nickfrostatx, did you get that working so this PR can be merged? |
@nickfrostatx thank you for taking the time to send this PR! Unfortunately, there was no activity in it for more than two weeks, so I'm closing this. If you have time to work on it again in the future feel free to open another one, we'll be happy to review and merge it! |
With
-Znll-dump-cause
, when a borrow check fails because of aDropVar
, theLocalDecl
for that variable may not have a name.Fixes #47646