1
Fork 0
This commit is contained in:
Esteban Kuber 2021-12-10 17:22:33 +00:00
parent 40f161aeb0
commit d2d9eb3715

View file

@ -126,22 +126,23 @@ impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
lifetime, lifetime,
); );
let (mention_influencer, influencer_point) = if sup_origin.span().overlaps(param.param_ty_span) { let (mention_influencer, influencer_point) =
// Account for `async fn` like in `async-await/issues/issue-62097.rs`. if sup_origin.span().overlaps(param.param_ty_span) {
// The desugaring of `async `fn`s causes `sup_origin` and `param` to point at the same // Account for `async fn` like in `async-await/issues/issue-62097.rs`.
// place (but with different `ctxt`, hence `overlaps` instead of `==` above). // 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: //
// // This avoids the following:
// LL | pub async fn run_dummy_fn(&self) { //
// | ^^^^^ // LL | pub async fn run_dummy_fn(&self) {
// | | // | ^^^^^
// | this data with an anonymous lifetime `'_`... // | |
// | ...is captured here... // | this data with an anonymous lifetime `'_`...
(false, sup_origin.span()) // | ...is captured here...
} else { (false, sup_origin.span())
(!sup_origin.span().overlaps(return_sp), param.param_ty_span) } else {
}; (!sup_origin.span().overlaps(return_sp), param.param_ty_span)
};
err.span_label(influencer_point, &format!("this data with {}...", lifetime)); err.span_label(influencer_point, &format!("this data with {}...", lifetime));
debug!("try_report_static_impl_trait: param_info={:?}", param); debug!("try_report_static_impl_trait: param_info={:?}", param);