Add collection of impl Trait argument lifetimes

This commit is contained in:
Christopher Vittal 2017-11-10 12:45:34 -05:00
parent 94df3c5edf
commit f225fe43f1

View file

@ -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