Skip to content

Commit cd9ec27

Browse files
committed
cleanup polonius liveness fact generation: mir visitor
have a variable instead of calling a method while constructing the extractor
1 parent e6d8fbe commit cd9ec27

File tree

1 file changed

+3
-3
lines changed
  • src/librustc_mir/borrow_check/nll/type_check/liveness

1 file changed

+3
-3
lines changed

src/librustc_mir/borrow_check/nll/type_check/liveness/polonius.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,15 @@ pub(super) fn populate_access_facts(
9393
debug!("populate_var_liveness_facts()");
9494

9595
if let Some(facts) = typeck.borrowck_context.all_facts.as_mut() {
96-
UseFactsExtractor {
96+
let mut extractor = UseFactsExtractor {
9797
var_defined: &mut facts.var_defined,
9898
var_used: &mut facts.var_used,
9999
var_drop_used: drop_used,
100100
path_accessed_at: &mut facts.path_accessed_at,
101101
location_table,
102102
move_data,
103-
}
104-
.visit_body(body);
103+
};
104+
extractor.visit_body(body);
105105

106106
facts.var_drop_used.extend(drop_used.iter().map(|&(local, location)| {
107107
(local, location_table.mid_index(location))

0 commit comments

Comments
 (0)