remove last vestiges of the old check#244
Conversation
|
I have to rebase this and drop the first two commits I think |
7e62c1c to
f3f57e9
Compare
This comment has been minimized.
This comment has been minimized.
| expect_test::expect![[r#" | ||
| the rule "borrow of disjoint places" at (nll.rs) failed because | ||
| condition evaluted to false: `place_disjoint_from_place(&loan.place.to_place_expression(), &access.place)` | ||
| &loan.place.to_place_expression() = *(local(m)) | ||
| &access.place = *(local(m)) | ||
|
|
||
| the rule "loan_not_required_by_universal_regions" at (nll.rs) failed because | ||
| condition evaluted to false: `outlived_by_loan.iter().all(|p| match p | ||
| { | ||
| Parameter::Ty(_) => false, Parameter::Lt(lt) => match lt.data() | ||
| { | ||
| LtData::Static => false, LtData::Variable(Variable::UniversalVar(_)) | ||
| => false, LtData::Variable(Variable::ExistentialVar(_)) => true, | ||
| LtData::Variable(Variable::BoundVar(_)) => | ||
| panic!("cannot outlive a bound var"), | ||
| }, Parameter::Const(_) => panic!("cannot outlive a constant"), | ||
| })` | ||
|
|
||
| the rule "write-indirect" at (nll.rs) failed because | ||
| pattern `TypedPlaceExpressionKind::Deref(place_loaned_ref)` did not match value `local(m)` | ||
|
|
||
| the rule "write-indirect" at (nll.rs) failed because | ||
| condition evaluted to false: `place_accessed.is_prefix_of(&place_loaned_ref.to_place_expression())` | ||
| place_accessed = *(local(m)) | ||
| &place_loaned_ref.to_place_expression() = local(m)"#]] |
There was a problem hiding this comment.
It's interesting that this problem case 3 test passed. I suppose it is related to the change where we move verify_universal_outlives to prove_judgment, but I don't really understand why.
There was a problem hiding this comment.
same, I don't understand why this changed either, nor why checking for universal subset errors more or at a different place would change anything here.
There was a problem hiding this comment.
The reason that problem case number 3 passes now is because we are no longer collecting all the outlives relations in a pre-pass and then using them everywhere along the graph, but rather accumulating them as we go. This is the heart of polonius, basically, and so it fixes this behavior.
There was a problem hiding this comment.
We should be able to remove this function, it is no longer used.
| @@ -134,19 +135,9 @@ enum AccessKind { | |||
| /// Given the `TypeckEnv`, and a (populated) list of `pending_outlives` | |||
There was a problem hiding this comment.
we can also remove this mention of pending_outlives since it's removed in this commit
| $*params | ||
|
|
||
| #[term(minirust { | ||
| // then declare the body |
| expect_test::expect![[r#" | ||
| the rule "borrow of disjoint places" at (nll.rs) failed because | ||
| condition evaluted to false: `place_disjoint_from_place(&loan.place.to_place_expression(), &access.place)` | ||
| &loan.place.to_place_expression() = *(local(m)) | ||
| &access.place = *(local(m)) | ||
|
|
||
| the rule "loan_not_required_by_universal_regions" at (nll.rs) failed because | ||
| condition evaluted to false: `outlived_by_loan.iter().all(|p| match p | ||
| { | ||
| Parameter::Ty(_) => false, Parameter::Lt(lt) => match lt.data() | ||
| { | ||
| LtData::Static => false, LtData::Variable(Variable::UniversalVar(_)) | ||
| => false, LtData::Variable(Variable::ExistentialVar(_)) => true, | ||
| LtData::Variable(Variable::BoundVar(_)) => | ||
| panic!("cannot outlive a bound var"), | ||
| }, Parameter::Const(_) => panic!("cannot outlive a constant"), | ||
| })` | ||
|
|
||
| the rule "write-indirect" at (nll.rs) failed because | ||
| pattern `TypedPlaceExpressionKind::Deref(place_loaned_ref)` did not match value `local(m)` | ||
|
|
||
| the rule "write-indirect" at (nll.rs) failed because | ||
| condition evaluted to false: `place_accessed.is_prefix_of(&place_loaned_ref.to_place_expression())` | ||
| place_accessed = *(local(m)) | ||
| &place_loaned_ref.to_place_expression() = local(m)"#]] |
There was a problem hiding this comment.
same, I don't understand why this changed either, nor why checking for universal subset errors more or at a different place would change anything here.
| LivePlaces, | ||
| }, | ||
| mini_rust_check::{ty_is_adt, ty_is_ref, Location, PendingOutlives, TypeckEnv}, | ||
| mini_rust_check::{ty_is_adt, ty_is_int, ty_is_ref, Location, PendingOutlives, TypeckEnv}, |
There was a problem hiding this comment.
did retcon fail in this commit? the message looks more about the previous commit than this one
| LivePlaces, | ||
| }, | ||
| mini_rust_check::{ty_is_adt, ty_is_int, ty_is_ref, Location, PendingOutlives, TypeckEnv}, | ||
| mini_rust_check::{ty_is_adt, ty_is_ref, Location, PendingOutlives, TypeckEnv}, |
There was a problem hiding this comment.
this is the inverse of the previous commit? "fix: check switch discriminant is an integer type in NLL"? :/
Move verify_universal_outlives check from the return terminator into prove_judgment, so it runs every time outlives constraints accumulate. This catches unsound universal region relationships even in code that never returns (e.g., infinite loops). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
f3f57e9 to
60b1620
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
- Remove dead `check_blocks` function - Update stale `pending_outlives` doc comment - Fix "then declare the body" → "the body" comment Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
We discussed this in detail. We decided to merge the code but to open a FIXME about adding back in the outlives constraints needed to accurately model NLL-as-it-is-today. |
|
I was surprised this wasn't merged yet, especially because I mistakenly said it was in our call yesterday, apologies. So I've made CI green and took care of
Done in #253 |
No description provided.