-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rooting of boxes in borrowck fails to take moves into account #3053
Comments
I have a fix for this but it will not make it to 0.6 |
@nikomatsakis is this fixed? There have been a lot of borrowck changes recently. Also, that example is so old I'm not even sure how to modernize it... |
@nikomatsakis , what's the status of this? |
I think I fixed this :) let me see if I added a test |
Just added a PR with a test, since I didn't see one. I violated rule #1 of test writing though in that I did not observe a test failure; it'd be a pain to do so, but I did inspect code and generated LLVM to make sure that we're creating the right pattern here. |
for reference, here is the code that attempts to fix this scenario: https://github.com/mozilla/rust/blob/master/src/librustc/middle/borrowck/gather_loans/lifetime.rs#L96 |
I don't see a failure with d2cf295 |
I don't have back that far, unfortunately. On Tue, Nov 12, 2013 at 8:06 PM, Huon Wilson notifications@github.comwrote:
|
Use dependabot to update the `s2n-quic` submodule weekly (every Monday). This is to avoid having to do this effort manually, and to guarantee that none of the `s2n-quic` proofs break due to changes in Kani. I've tested this in my own fork, and it seemed to work correctly.
The following code:
is handled incorrectly by borrowck right now. It will opt not to root the
x.f
box even though it ought to. This is because it sees thatx.f
is found in immutable data which will outlive the lifetime of the borrow: but it doesn't consider moves. To be correct, it should either (1) know which variables might be moved (liveness can tell us) and conservatively root boxes that are found in those variables or (2) take out a loan onx
so that an error would be reported. But (2) seems suboptimal since this is not really an error, just a failure of borrowck to make the right call on whether to rootx.f
.The text was updated successfully, but these errors were encountered: