Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ada5e2c

Browse files
committedMay 31, 2024
Auto merge of rust-lang#125824 - matthiaskrgr:rollup-eam7i0p, r=matthiaskrgr
Rollup of 7 pull requests Successful merges: - rust-lang#125652 (Revert propagation of drop-live information from Polonius) - rust-lang#125730 (Apply `x clippy --fix` and `x fmt` on Rustc) - rust-lang#125756 (coverage: Optionally instrument the RHS of lazy logical operators) - rust-lang#125776 (Stop using `translate_args` in the new solver) - rust-lang#125796 (Also InstSimplify `&raw*`) - rust-lang#125807 (Also resolve the type of constants, even if we already turned it into an error constant) - rust-lang#125816 (Don't build the `rust-demangler` binary for coverage tests) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 2a2c29a + df9cd17 commit ada5e2c

File tree

51 files changed

+876
-162
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+876
-162
lines changed
 

‎compiler/rustc_borrowck/src/type_check/liveness/mod.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ use std::rc::Rc;
1414
use crate::{
1515
constraints::OutlivesConstraintSet,
1616
facts::{AllFacts, AllFactsExt},
17-
location::LocationTable,
1817
region_infer::values::LivenessValues,
1918
universal_regions::UniversalRegions,
2019
};
@@ -39,7 +38,6 @@ pub(super) fn generate<'mir, 'tcx>(
3938
elements: &Rc<DenseLocationMap>,
4039
flow_inits: &mut ResultsCursor<'mir, 'tcx, MaybeInitializedPlaces<'mir, 'tcx>>,
4140
move_data: &MoveData<'tcx>,
42-
location_table: &LocationTable,
4341
use_polonius: bool,
4442
) {
4543
debug!("liveness::generate");
@@ -53,11 +51,9 @@ pub(super) fn generate<'mir, 'tcx>(
5351
compute_relevant_live_locals(typeck.tcx(), &free_regions, body);
5452
let facts_enabled = use_polonius || AllFacts::enabled(typeck.tcx());
5553

56-
let polonius_drop_used = facts_enabled.then(|| {
57-
let mut drop_used = Vec::new();
58-
polonius::populate_access_facts(typeck, body, location_table, move_data, &mut drop_used);
59-
drop_used
60-
});
54+
if facts_enabled {
55+
polonius::populate_access_facts(typeck, body, move_data);
56+
};
6157

6258
trace::trace(
6359
typeck,
@@ -67,7 +63,6 @@ pub(super) fn generate<'mir, 'tcx>(
6763
move_data,
6864
relevant_live_locals,
6965
boring_locals,
70-
polonius_drop_used,
7166
);
7267

7368
// Mark regions that should be live where they appear within rvalues or within a call: like

‎compiler/rustc_borrowck/src/type_check/liveness/polonius.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,10 @@ impl<'a, 'tcx> Visitor<'tcx> for UseFactsExtractor<'a, 'tcx> {
8585
pub(super) fn populate_access_facts<'a, 'tcx>(
8686
typeck: &mut TypeChecker<'a, 'tcx>,
8787
body: &Body<'tcx>,
88-
location_table: &LocationTable,
8988
move_data: &MoveData<'tcx>,
90-
//FIXME: this is not mutated, but expected to be modified as
91-
// out param, bug?
92-
dropped_at: &mut Vec<(Local, Location)>,
9389
) {
9490
debug!("populate_access_facts()");
91+
let location_table = typeck.borrowck_context.location_table;
9592

9693
if let Some(facts) = typeck.borrowck_context.all_facts.as_mut() {
9794
let mut extractor = UseFactsExtractor {
@@ -104,10 +101,6 @@ pub(super) fn populate_access_facts<'a, 'tcx>(
104101
};
105102
extractor.visit_body(body);
106103

107-
facts.var_dropped_at.extend(
108-
dropped_at.iter().map(|&(local, location)| (local, location_table.mid_index(location))),
109-
);
110-
111104
for (local, local_decl) in body.local_decls.iter_enumerated() {
112105
debug!(
113106
"add use_of_var_derefs_origin facts - local={:?}, type={:?}",

0 commit comments

Comments
 (0)
Please sign in to comment.