Always create parameters for functions-like types.
This commit is contained in:
parent
4b79b8bfa1
commit
32af719b07
20 changed files with 303 additions and 177 deletions
|
@ -2223,9 +2223,18 @@ impl<'tcx> LifetimeContext<'_, 'tcx> {
|
|||
]
|
||||
.contains(&Some(did))
|
||||
{
|
||||
let (span, span_type) = match &trait_ref.bound_generic_params {
|
||||
[] => (trait_ref.span.shrink_to_lo(), ForLifetimeSpanType::BoundEmpty),
|
||||
[.., bound] => (bound.span.shrink_to_hi(), ForLifetimeSpanType::BoundTail),
|
||||
let (span, span_type) = if let Some(bound) =
|
||||
trait_ref.bound_generic_params.iter().rfind(|param| {
|
||||
matches!(
|
||||
param.kind,
|
||||
hir::GenericParamKind::Lifetime {
|
||||
kind: hir::LifetimeParamKind::Explicit
|
||||
}
|
||||
)
|
||||
}) {
|
||||
(bound.span.shrink_to_hi(), ForLifetimeSpanType::BoundTail)
|
||||
} else {
|
||||
(trait_ref.span.shrink_to_lo(), ForLifetimeSpanType::BoundEmpty)
|
||||
};
|
||||
self.missing_named_lifetime_spots
|
||||
.push(MissingLifetimeSpot::HigherRanked { span, span_type });
|
||||
|
|
|
@ -755,7 +755,9 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
|
|||
let next_early_index = self.next_early_index();
|
||||
let lifetime_span: Option<Span> =
|
||||
c.generic_params.iter().rev().find_map(|param| match param.kind {
|
||||
GenericParamKind::Lifetime { .. } => Some(param.span),
|
||||
GenericParamKind::Lifetime { kind: hir::LifetimeParamKind::Explicit } => {
|
||||
Some(param.span)
|
||||
}
|
||||
_ => None,
|
||||
});
|
||||
let (span, span_type) = if let Some(span) = lifetime_span {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue