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

Closed
wants to merge 1 commit into from

2 participants

@catamorphism

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.

@catamorphism catamorphism Make borrowck's notion of scopes consistent with trans's notion of sc…
…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 #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.
0870b22
@nikomatsakis

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

Merged as 9d67267

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment