cleanup polonius liveness fact generation: mir visitor
have a variable instead of calling a method while constructing the extractor
This commit is contained in:
parent
e6d8fbede2
commit
cd9ec277c5
@ -93,15 +93,15 @@ pub(super) fn populate_access_facts(
|
|||||||
debug!("populate_var_liveness_facts()");
|
debug!("populate_var_liveness_facts()");
|
||||||
|
|
||||||
if let Some(facts) = typeck.borrowck_context.all_facts.as_mut() {
|
if let Some(facts) = typeck.borrowck_context.all_facts.as_mut() {
|
||||||
UseFactsExtractor {
|
let mut extractor = UseFactsExtractor {
|
||||||
var_defined: &mut facts.var_defined,
|
var_defined: &mut facts.var_defined,
|
||||||
var_used: &mut facts.var_used,
|
var_used: &mut facts.var_used,
|
||||||
var_drop_used: drop_used,
|
var_drop_used: drop_used,
|
||||||
path_accessed_at: &mut facts.path_accessed_at,
|
path_accessed_at: &mut facts.path_accessed_at,
|
||||||
location_table,
|
location_table,
|
||||||
move_data,
|
move_data,
|
||||||
}
|
};
|
||||||
.visit_body(body);
|
extractor.visit_body(body);
|
||||||
|
|
||||||
facts.var_drop_used.extend(drop_used.iter().map(|&(local, location)| {
|
facts.var_drop_used.extend(drop_used.iter().map(|&(local, location)| {
|
||||||
(local, location_table.mid_index(location))
|
(local, location_table.mid_index(location))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user