]> git.lizzy.rs Git - rust.git/commit
Restrict two-phase borrows to solely borrows introduced via autoref.
authorFelix S. Klock II <pnkfelix@pnkfx.org>
Tue, 16 Jan 2018 09:52:52 +0000 (10:52 +0100)
committerFelix S. Klock II <pnkfelix@pnkfx.org>
Thu, 8 Feb 2018 11:16:30 +0000 (12:16 +0100)
commit1855ab742458cc4359e27deadbdf3d8747ce361d
treed33b5aedc00abf0d1116a9cc70005b1de1a18658
parentc00266b7ac97a8c04136e14f10eb70fb64ec2c94
Restrict two-phase borrows to solely borrows introduced via autoref.

Added `-Z two-phase-beyond-autoref` to bring back old behavior (mainly
to allow demonstration of desugared examples).

Updated tests to use aforementioned flag when necessary. (But in each
case where I added the flag, I made sure to also include a revision
without the flag so that one can readily see what the actual behavior
we expect is for the initial deployment of NLL.)
src/librustc/mir/mod.rs
src/librustc/session/config.rs
src/librustc_mir/borrow_check/mod.rs
src/test/compile-fail/borrowck/two-phase-activation-sharing-interference.rs
src/test/compile-fail/borrowck/two-phase-allow-access-during-reservation.rs
src/test/compile-fail/borrowck/two-phase-reservation-sharing-interference.rs