about summary refs log tree commit diff
diff options
context:
space:
mode:
authorChristopher Vittal <christopher.vittal@gmail.com>2017-11-10 12:45:34 -0500
committerChristopher Vittal <christopher.vittal@gmail.com>2017-11-15 15:46:01 -0500
commitf225fe43f14a8a3887aca558f20c7d7e990b591e (patch)
tree9330c4deaa4e5476ed3e45d125928057a1b57115
parent94df3c5edfcd5ffb176286b1c060cfe4244a8f23 (diff)
downloadrust-f225fe43f14a8a3887aca558f20c7d7e990b591e.tar.gz
rust-f225fe43f14a8a3887aca558f20c7d7e990b591e.zip
Add collection of impl Trait argument lifetimes
-rw-r--r--src/librustc/middle/resolve_lifetime.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/librustc/middle/resolve_lifetime.rs b/src/librustc/middle/resolve_lifetime.rs
index fc6f6ed9aa8..8c299612064 100644
--- a/src/librustc/middle/resolve_lifetime.rs
+++ b/src/librustc/middle/resolve_lifetime.rs
@@ -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