From d2d9eb3715e61d16eafb55b4b8cb03fdc6bfc871 Mon Sep 17 00:00:00 2001 From: Esteban Kuber Date: Fri, 10 Dec 2021 17:22:33 +0000 Subject: [PATCH] fmt --- .../nice_region_error/static_impl_trait.rs | 33 ++++++++++--------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/compiler/rustc_infer/src/infer/error_reporting/nice_region_error/static_impl_trait.rs b/compiler/rustc_infer/src/infer/error_reporting/nice_region_error/static_impl_trait.rs index 36d88029252..80d4a2e57da 100644 --- a/compiler/rustc_infer/src/infer/error_reporting/nice_region_error/static_impl_trait.rs +++ b/compiler/rustc_infer/src/infer/error_reporting/nice_region_error/static_impl_trait.rs @@ -126,22 +126,23 @@ impl<'a, 'tcx> NiceRegionError<'a, 'tcx> { lifetime, ); - let (mention_influencer, influencer_point) = if sup_origin.span().overlaps(param.param_ty_span) { - // Account for `async fn` like in `async-await/issues/issue-62097.rs`. - // The desugaring of `async `fn`s causes `sup_origin` and `param` to point at the same - // place (but with different `ctxt`, hence `overlaps` instead of `==` above). - // - // This avoids the following: - // - // LL | pub async fn run_dummy_fn(&self) { - // | ^^^^^ - // | | - // | this data with an anonymous lifetime `'_`... - // | ...is captured here... - (false, sup_origin.span()) - } else { - (!sup_origin.span().overlaps(return_sp), param.param_ty_span) - }; + let (mention_influencer, influencer_point) = + if sup_origin.span().overlaps(param.param_ty_span) { + // Account for `async fn` like in `async-await/issues/issue-62097.rs`. + // The desugaring of `async `fn`s causes `sup_origin` and `param` to point at the same + // place (but with different `ctxt`, hence `overlaps` instead of `==` above). + // + // This avoids the following: + // + // LL | pub async fn run_dummy_fn(&self) { + // | ^^^^^ + // | | + // | this data with an anonymous lifetime `'_`... + // | ...is captured here... + (false, sup_origin.span()) + } else { + (!sup_origin.span().overlaps(return_sp), param.param_ty_span) + }; err.span_label(influencer_point, &format!("this data with {}...", lifetime)); debug!("try_report_static_impl_trait: param_info={:?}", param);