Skip to content

Make borrowck's notion of scopes consistent with trans's notion of scope... #4539

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

Closed
wants to merge 1 commit into from

Conversation

catamorphism
Copy link
Contributor

r? @nikomatsakis

This eliminates an ICE in trans where the scope for a particular
borrow was a statement ID, but the code in trans that does cleanups
wasn't finding the block with that scope. As per #3860

preserve looks at a node ID to see if it's for a statement -- if it
is, it uses the enclosing scope instead when updating the map that
trans looks at later.

…opes

This eliminates an ICE in trans where the scope for a particular
borrow was a statement ID, but the code in trans that does cleanups
wasn't finding the block with that scope. As per rust-lang#3860

preserve looks at a node ID to see if it's for a statement -- if it
is, it uses the enclosing scope instead when updating the map that
trans looks at later.
@nikomatsakis
Copy link
Contributor

So, pre-INHTWAMA this would seem inelegant but harmless, since all it would do is keep a managed box alive longer than necessary. Post-INHTWAMA, though, this will cause boxes to be frozen longer than they logically should be. Let's discuss today (I'll be in the office)

@catamorphism
Copy link
Contributor Author

Merged as 9d67267

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants