]> git.lizzy.rs Git - rust.git/commit
Address Issue 14270 by making `cmt::freely_aliasable` result more fine-grained.
authorFelix S. Klock II <pnkfelix@pnkfx.org>
Sun, 29 Mar 2015 23:11:11 +0000 (01:11 +0200)
committerFelix S. Klock II <pnkfelix@pnkfx.org>
Mon, 30 Mar 2015 12:10:45 +0000 (14:10 +0200)
commitf513380cf51eb5fd977b8815a7acd999e424dc93
treef34be5c0599b0c1764d88abed2139a894db1df83
parent492b3b163fc003658eece850fc241248dd66db02
Address Issue 14270 by making `cmt::freely_aliasable` result more fine-grained.

Instead of encoding the aliasability (i.e. whether the cmt is uniquely
writable or not) as an option, now pass back an enum indicating
either: 1. freely-aliasable (thus not uniquely-writable),
2. non-aliasble (thus uniquely writable), or 3. unique but immutable
(and thus not uniquely writable, according to proposal from issue
14270.)

This is all of course a giant hack that will hopefully go away with an
eventually removal of special treatment of `Box<T>` (aka `ty_unique`)
from the compiler.
src/librustc/middle/mem_categorization.rs
src/librustc_borrowck/borrowck/check_loans.rs
src/librustc_borrowck/borrowck/gather_loans/mod.rs
src/librustc_borrowck/borrowck/mod.rs