summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_borrowck/src/type_check/liveness/local_use_map.rs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_borrowck/src/type_check/liveness/local_use_map.rs')
-rw-r--r--compiler/rustc_borrowck/src/type_check/liveness/local_use_map.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_borrowck/src/type_check/liveness/local_use_map.rs b/compiler/rustc_borrowck/src/type_check/liveness/local_use_map.rs
index 8023ef60d..2c387edfe 100644
--- a/compiler/rustc_borrowck/src/type_check/liveness/local_use_map.rs
+++ b/compiler/rustc_borrowck/src/type_check/liveness/local_use_map.rs
@@ -63,7 +63,7 @@ impl LocalUseMap {
elements: &RegionValueElements,
body: &Body<'_>,
) -> Self {
- let nones = IndexVec::from_elem_n(None, body.local_decls.len());
+ let nones = IndexVec::from_elem(None, &body.local_decls);
let mut local_use_map = LocalUseMap {
first_def_at: nones.clone(),
first_use_at: nones.clone(),
@@ -76,7 +76,7 @@ impl LocalUseMap {
}
let mut locals_with_use_data: IndexVec<Local, bool> =
- IndexVec::from_elem_n(false, body.local_decls.len());
+ IndexVec::from_elem(false, &body.local_decls);
live_locals.iter().for_each(|&local| locals_with_use_data[local] = true);
LocalUseMapBuild { local_use_map: &mut local_use_map, elements, locals_with_use_data }