diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-02-26 00:49:20 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-02-26 00:49:20 +0100 |
| commit | 3b276cbe044a528e5966a4dc729fdfd662724f8c (patch) | |
| tree | 98098dc6c7b39e3c6da55aeb0d502bf80422312e /compiler/rustc_mir_dataflow/src/impls/mod.rs | |
| parent | d3ad51b48f83329fac0cd8a9f1253f3146613c1c (diff) | |
| parent | 42371a502fd82b33bfbc777b53948432e91a60ef (diff) | |
| download | rust-3b276cbe044a528e5966a4dc729fdfd662724f8c.tar.gz rust-3b276cbe044a528e5966a4dc729fdfd662724f8c.zip | |
Rollup merge of #93603 - connorff:compute-polonius-liveness-facts-flag, r=ecstatic-morse
Populate liveness facts when calling `get_body_with_borrowck_facts` without `-Z polonius` For a new feature of [Flowistry](https://github.com/willcrichton/flowistry), a static-analysis tool, we need to obtain a `mir::Body`'s liveness facts using `get_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 of `AllFacts::enabled` (which is toggled via compiler args). This PR propagates the [`use_polonius`](https://github.com/rust-lang/rust/blob/8b09ba6a5d5c644fe0f1c27c7f9c80b334241707/compiler/rustc_borrowck/src/nll.rs#L168) flag to `liveness::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!
Diffstat (limited to 'compiler/rustc_mir_dataflow/src/impls/mod.rs')
0 files changed, 0 insertions, 0 deletions
