Uh oh!
There was an error while loading. Please reload this page.
Kill conflicting borrows of places with projections. - #62010
Conversation
Resolvesrust-lang#62007. Due to a bug, the previous version of this check did not actually kill any conflicting borrows unless the borrowed place had no projections. Specifically, `entry_set` will always be empty when `statement_effect` is called. It does not contain the set of borrows which are live at this point in the program.
Uh oh!
There was an error while loading. Please reload this page.
The test passed, so that's good. It would be good to add tests of each of the other kinds of projections, and check how they are handled. The test you've added here handles At the very least, I'd like to see:
It would of course be good to cover the other |
pnkfelix
commented
Jun 21, 2019
(the code changes here look good, too. I'll actually see about adding the tests I described so that we can get this into the pipeline to land sooner rather than later.) |
overwriting one field should not allow reborrow of an unrelated field.
pnkfelix
commented
Jun 21, 2019
I tried to make a variant of the tests I added above that covered the case of a downcast-projection, but I'm not sure if I know a way to get a downcast projection onto the righthand side of an assignment in the form that we need here to observe the phenomenon being tested. So I'm not going to worry about adding a test for that case at this point. (LIkewise, I'm not going to worry about subslice projection either.) |
pnkfelix
commented
Jun 21, 2019
r=me assuming the tests I added all pass the CI. |
pnkfelix
commented
Jun 21, 2019
@bors r+ |
bors
commented
Jun 21, 2019
📌 Commit f483269 has been approved by |
pnkfelix
commented
Jun 21, 2019
@bors rollup=never (This PR may affect performance. I don't think it will, so I'm not blocking it on a perf run. But I also want it to be apparent in the graphs if this PR does affect performance.) |
…, r=pnkfelix Kill conflicting borrows of places with projections. Resolvesrust-lang#62007. Due to a bug, the previous version of this check did not actually kill all conflicting borrows unless the borrowed place had no projections. Specifically, `sets.on_entry` will always be empty when `statement_effect` is called. It does not contain the set of borrows which are live at this point in the program. @pnkfelix describes why this was not caught before in rust-lang#62007, and created an example where the current borrow checker failed unnecessarily. This PR adds their example as a test, but they will likely want to add some additional ones. r? @pnkfelix
…, r=pnkfelix Kill conflicting borrows of places with projections. Resolvesrust-lang#62007. Due to a bug, the previous version of this check did not actually kill all conflicting borrows unless the borrowed place had no projections. Specifically, `sets.on_entry` will always be empty when `statement_effect` is called. It does not contain the set of borrows which are live at this point in the program. @pnkfelix describes why this was not caught before in rust-lang#62007, and created an example where the current borrow checker failed unnecessarily. This PR adds their example as a test, but they will likely want to add some additional ones. r? @pnkfelix
pnkfelix
commented
Jun 21, 2019
@Centril did I mistype the command for indicating this PR should not be included in a rollup? |
Centril
commented
Jun 21, 2019
bors
commented
Jun 22, 2019
Kill conflicting borrows of places with projections. Resolves#62007. Due to a bug, the previous version of this check did not actually kill all conflicting borrows unless the borrowed place had no projections. Specifically, `sets.on_entry` will always be empty when `statement_effect` is called. It does not contain the set of borrows which are live at this point in the program. @pnkfelix describes why this was not caught before in #62007, and created an example where the current borrow checker failed unnecessarily. This PR adds their example as a test, but they will likely want to add some additional ones. r? @pnkfelix
kennytm
commented
Jun 22, 2019
@Centril Please file a feature request on rust-lang/homu |
bors
commented
Jun 22, 2019
☀️ Test successful - checks-travis, status-appveyor |
Resolves#62007.
Due to a bug, the previous version of this check did not actually kill all conflicting borrows unless the borrowed place had no projections. Specifically,
sets.on_entrywill always be empty whenstatement_effectis called. It does not contain the set of borrows which are live at this point in the program.@pnkfelix describes why this was not caught before in #62007, and created an example where the current borrow checker failed unnecessarily. This PR adds their example as a test, but they will likely want to add some additional ones.
r? @pnkfelix