Repository navigation
Conversation
Collaborator
|
|
Member
Author
|
Disclosure: an LLM was used to generate a first pass at the tests and for early investigation. |
lqd
reviewed
Sep 28, 2026
| // considered live for the entire function. Any deferred regions *are* | ||
| // regions that fit this category. | ||
| if let Some((polonius_context, move_data, borrow_set)) = polonius_context_and_args { | ||
| polonius_context.compute_loan_liveness( |
Member
There was a problem hiding this comment.
This is the downside of having the regioncx solving be in this module, if we have to propagate loans on the unsolved regioncx, it feels very very hidden to do it here. We discussed maybe having this in nll.rs.
Comment on lines
+257
to
+263
| unsolved_regioncx | ||
| .inner | ||
| .constraints | ||
| .outlives() | ||
| .iter() | ||
| .copied() | ||
| .chain(unsolved_regioncx.type_test_constraints.iter().copied()), |
Member
There was a problem hiding this comment.
The rationale is not clear to me on why we need to pass these via this side-channel. So I'd like us to discuss the entire commit.
A bunch of it feels like workarounds for the lack of intersection regions, and some inability to register actual outlives constraints.
rust-cloud-vms
Bot
force-pushed
the
polonius-unsoundness-2
branch
from
September 30, 2026 15:18
9260398 to
7024200
Compare
rust-cloud-vms
Bot
force-pushed
the
polonius-unsoundness-2
branch
from
September 30, 2026 15:22
7024200 to
8d039b2
Compare
rust-cloud-vms
Bot
force-pushed
the
polonius-unsoundness-2
branch
from
September 30, 2026 15:35
bdb9831 to
f7c15cb
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If you have:
At
require_static(y), we require that(impl Copy + 'a + 'b): 'static, which we do by registering a type test that either'a: 'staticOR'b: 'static. Neither is registered as a normal region constraint - and so it is not used to compute loan liveness.In this PR, anytime we discharge a type test, we register all the constraints that could have been used to prove that type test at the location of the type test itself.
You might ask: why all? Surely, we could have registered only
'a: 'staticor'b: 'static? The problem, is that we don't know what constraints later code may rely on (and in fact, if we registered only 'b: 'static, then that would be a soundness hole - because'bisn't live). Though, if'b: 'static` didn't hold, we wouldn't register it.This fixes bug two here: https://rust-lang.zulipchat.com/#narrow/channel/186049-t-types.2Fpolonius/topic/Reporting.20a.20few.20Polonius.20bugs/near/617350569
r? lqd