diff --git a/src/stacked_borrows.rs b/src/stacked_borrows.rs index d28c6425cd4..75c2ff26587 100644 --- a/src/stacked_borrows.rs +++ b/src/stacked_borrows.rs @@ -543,16 +543,9 @@ impl<'tcx> Stack { // Now we figure out which item grants our parent (`derived_from`) this kind of access. // We use that to determine where to put the new item. let granting_idx = - self.find_granting(access, derived_from, exposed_tags).map_err(|_| { - alloc_history.grant_error( - derived_from, - new, - alloc_id, - alloc_range, - offset, - self, - ) - })?; + self.find_granting(access, derived_from, exposed_tags).map_err(|_| { + alloc_history.grant_error(derived_from, new, alloc_id, alloc_range, offset, self) + })?; // Compute where to put the new item. // Either way, we ensure that we insert the new item in a way such that between @@ -595,7 +588,9 @@ impl<'tcx> Stack { self.borrows.len() }; // Put the new item there. As an optimization, deduplicate if it is equal to one of its new neighbors. - if self.borrows.get(new_idx) == Some(&new) || new_idx > 0 && self.borrows.get(new_idx - 1) == Some(&new) { + if self.borrows.get(new_idx) == Some(&new) + || new_idx > 0 && self.borrows.get(new_idx - 1) == Some(&new) + { // Optimization applies, done. trace!("reborrow: avoiding adding redundant item {:?}", new); } else { diff --git a/src/stacked_borrows/diagnostics.rs b/src/stacked_borrows/diagnostics.rs index 6a22d9a7439..91dfe22c196 100644 --- a/src/stacked_borrows/diagnostics.rs +++ b/src/stacked_borrows/diagnostics.rs @@ -208,11 +208,7 @@ impl AllocHistory { ) -> InterpError<'tcx> { // TODO: Fix this properly let z = &derived_from; - let f = if let Some(ref t) = z { - t as &dyn Debug - } else { - &"" as &dyn Debug - }; + let f = if let Some(ref t) = z { t as &dyn Debug } else { &"" as &dyn Debug }; let action = format!( "trying to reborrow {:?} for {:?} permission at {}[{:#x}]", f, @@ -240,11 +236,7 @@ impl AllocHistory { stack: &Stack, ) -> InterpError<'tcx> { let z = &tag; - let f = if let Some(ref t) = z { - t as &dyn Debug - } else { - &"" as &dyn Debug - }; + let f = if let Some(ref t) = z { t as &dyn Debug } else { &"" as &dyn Debug }; let action = format!( "attempting a {} using {:?} at {}[{:#x}]", access,