]> git.lizzy.rs Git - rust.git/commit
Make borrowck's notion of scopes consistent with trans's notion of scopes
authorTim Chevalier <chevalier@alum.wellesley.edu>
Mon, 14 Jan 2013 00:51:18 +0000 (16:51 -0800)
committerTim Chevalier <chevalier@alum.wellesley.edu>
Tue, 22 Jan 2013 23:59:45 +0000 (15:59 -0800)
commit9d672671e25855d9ca9813c55cc2fc33252de7b8
tree7366053909a969ac72a8b280142cccc6ab1a230c
parent519b60f313766d840123b48fbc9fc4b42948e6c0
Make borrowck's notion of scopes consistent with trans's notion of scopes

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.

I added a comment noting that this is not the best fix (since it may
cause boxes to be frozen for longer than necessary) and referring
to #3511.

r=nmatsakis
src/librustc/middle/borrowck/gather_loans.rs
src/librustc/middle/borrowck/mod.rs
src/librustc/middle/borrowck/preserve.rs
src/librustc/middle/region.rs
src/librustc/util/common.rs
src/test/run-pass/issue-3860.rs