From: Niko Matsakis Date: Thu, 6 Sep 2018 16:39:38 +0000 (-0400) Subject: universal_regions.rs: rustfmt X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=81f64b7fa31de97930560fe6d18b6e291f76a626;p=rust.git universal_regions.rs: rustfmt --- diff --git a/src/librustc_mir/borrow_check/nll/universal_regions.rs b/src/librustc_mir/borrow_check/nll/universal_regions.rs index ed2b7734406..51153128256 100644 --- a/src/librustc_mir/borrow_check/nll/universal_regions.rs +++ b/src/librustc_mir/borrow_check/nll/universal_regions.rs @@ -241,8 +241,9 @@ pub fn closure_mapping( region_mapping.push(fr); }); - for_each_late_bound_region_defined_on( - tcx, closure_base_def_id, |r| { region_mapping.push(r); }); + for_each_late_bound_region_defined_on(tcx, closure_base_def_id, |r| { + region_mapping.push(r); + }); assert_eq!( region_mapping.len(), @@ -352,9 +353,8 @@ fn build(self) -> UniversalRegions<'tcx> { // let c = || { let x: &'a u32 = ...; } // } if self.mir_def_id != closure_base_def_id { - self.infcx.replace_late_bound_regions_with_nll_infer_vars( - self.mir_def_id, - &mut indices) + self.infcx + .replace_late_bound_regions_with_nll_infer_vars(self.mir_def_id, &mut indices) } let bound_inputs_and_output = self.compute_inputs_and_output(&indices, defining_ty); @@ -371,9 +371,8 @@ fn build(self) -> UniversalRegions<'tcx> { // Converse of above, if this is a function then the late-bound regions declared on its // signature are local to the fn. if self.mir_def_id == closure_base_def_id { - self.infcx.replace_late_bound_regions_with_nll_infer_vars( - self.mir_def_id, - &mut indices); + self.infcx + .replace_late_bound_regions_with_nll_infer_vars(self.mir_def_id, &mut indices); } let fr_fn_body = self.infcx.next_nll_region_var(FR).to_region_vid(); @@ -582,11 +581,10 @@ fn replace_bound_regions_with_nll_infer_vars( where T: TypeFoldable<'tcx>; - fn replace_late_bound_regions_with_nll_infer_vars( &self, mir_def_id: DefId, - indices: &mut UniversalRegionIndices<'tcx> + indices: &mut UniversalRegionIndices<'tcx>, ); } @@ -710,11 +708,14 @@ pub fn fold_to_region_vids(&self, tcx: TyCtxt<'_, '_, 'tcx>, value: &T) -> T fn for_each_late_bound_region_defined_on<'tcx>( tcx: TyCtxt<'_, '_, 'tcx>, fn_def_id: DefId, - mut f: impl FnMut(ty::Region<'tcx>) - ) { + mut f: impl FnMut(ty::Region<'tcx>), +) { if let Some(late_bounds) = tcx.is_late_bound_map(fn_def_id.index) { for late_bound in late_bounds.iter() { - let hir_id = HirId{ owner: fn_def_id.index, local_id: *late_bound }; + let hir_id = HirId { + owner: fn_def_id.index, + local_id: *late_bound, + }; let region_node_id = tcx.hir.hir_to_node_id(hir_id); let name = tcx.hir.name(region_node_id).as_interned_str(); let region_def_id = tcx.hir.local_def_id(region_node_id);