Populate liveness facts when calling get_body_with_borrowck_facts
without -Z polonius
#93603
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.
For a new feature of Flowistry, a static-analysis tool, we need to obtain a
mir::Body
's liveness facts usingget_body_with_borrowck_facts
(added in #86977). We'd like to do this without passing-Z polonius
as a compiler arg to avoid borrow checking the entire crate.Support for doing this was added in #88983, but the Polonius input facts used for liveness analysis are empty. This happens because the liveness input facts are populated in
liveness::generate
depending only on the value ofAllFacts::enabled
(which is toggled via compiler args).This PR propagates the
use_polonius
flag toliveness::generate
to support populating liveness facts without requiring the-Z polonius
flag.This fix is somewhat patchy - if it'd be better to add more widely-accessible state (like
AllFacts::enabled
) I'd be open to ideas!