Add collection of impl Trait argument lifetimes
This commit is contained in:
parent
94df3c5edf
commit
f225fe43f1
1 changed files with 11 additions and 0 deletions
|
|
@ -1604,6 +1604,17 @@ fn insert_late_bound_lifetimes(map: &mut NamedRegionMap,
|
|||
walk_list!(&mut appears_in_where_clause,
|
||||
visit_where_predicate,
|
||||
&generics.where_clause.predicates);
|
||||
// We need to collect argument impl Trait lifetimes as well,
|
||||
// we do so here.
|
||||
walk_list!(&mut appears_in_where_clause,
|
||||
visit_ty,
|
||||
decl.inputs.iter().filter(|ty| {
|
||||
if let hir::TyImplTraitUniversal(..) = ty.node {
|
||||
true
|
||||
} else {
|
||||
false
|
||||
}
|
||||
}));
|
||||
for lifetime_def in &generics.lifetimes {
|
||||
if !lifetime_def.bounds.is_empty() {
|
||||
// `'a: 'b` means both `'a` and `'b` are referenced
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue