tidy fixes

This commit is contained in:
dylan_DPC 2018-07-20 00:22:57 +05:30
parent 2255786212
commit 9910dee677
3 changed files with 9 additions and 4 deletions

View file

@ -2933,4 +2933,4 @@ impl<'tcx> TypeFoldable<'tcx> for Literal<'tcx> {
}
}
newtype_index!(LocalWithRegion);
newtype_index!(LocalWithRegion);

View file

@ -408,7 +408,10 @@ impl ToRegionVid for RegionVid {
}
}
fn live_variable_set(regular: &LocalSet<LocalWithRegion>, drops: &LocalSet<LocalWithRegion>) -> String {
fn live_variable_set(
regular: &LocalSet<LocalWithRegion>,
drops: &LocalSet<LocalWithRegion>
) -> String {
// sort and deduplicate:
let all_locals: BTreeSet<_> = regular.iter().chain(drops.iter()).collect();

View file

@ -570,7 +570,10 @@ impl LiveVariableMap for NllLivenessMap {
impl NllLivenessMap {
pub fn compute(mir: &Mir) -> Self {
let mut to_local = IndexVec::default();
let from_local: IndexVec<Local,Option<_>> = mir.local_decls.iter_enumerated().map(|(local, local_decl)| {
let from_local: IndexVec<Local,Option<_>> = mir
.local_decls
.iter_enumerated()
.map(|(local, local_decl)| {
if local_decl.ty.has_free_regions() {
Some(to_local.push(local))
}
@ -582,4 +585,3 @@ impl NllLivenessMap {
Self { from_local, to_local }
}
}