]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc/hir/intravisit.rs
rustc: always include elidable lifetimes in HIR types.
[rust.git] / src / librustc / hir / intravisit.rs
index 4b171193b4af17f54dddbd2807f06a561daf1175..d71263bea0046a76105506ceaada2d47fe52d15c 100644 (file)
@@ -154,7 +154,7 @@ pub trait Visitor<'v> : Sized {
     /// hashed separately.
     ///
     /// **If for some reason you want the nested behavior, but don't
-    /// have a `Map` are your disposal:** then you should override the
+    /// have a `Map` at your disposal:** then you should override the
     /// `visit_nested_XXX` methods, and override this method to
     /// `panic!()`. This way, if a new `visit_nested_XXX` variant is
     /// added in the future, we will see the panic in your code and
@@ -547,8 +547,8 @@ pub fn walk_ty<'v, V: Visitor<'v>>(visitor: &mut V, typ: &'v Ty) {
         TyPtr(ref mutable_type) => {
             visitor.visit_ty(&mutable_type.ty)
         }
-        TyRptr(ref opt_lifetime, ref mutable_type) => {
-            walk_list!(visitor, visit_lifetime, opt_lifetime);
+        TyRptr(ref lifetime, ref mutable_type) => {
+            visitor.visit_lifetime(lifetime);
             visitor.visit_ty(&mutable_type.ty)
         }
         TyNever => {},
@@ -562,15 +562,11 @@ pub fn walk_ty<'v, V: Visitor<'v>>(visitor: &mut V, typ: &'v Ty) {
         TyPath(ref qpath) => {
             visitor.visit_qpath(qpath, typ.id, typ.span);
         }
-        TyObjectSum(ref ty, ref bounds) => {
-            visitor.visit_ty(ty);
-            walk_list!(visitor, visit_ty_param_bound, bounds);
-        }
         TyArray(ref ty, length) => {
             visitor.visit_ty(ty);
             visitor.visit_nested_body(length)
         }
-        TyPolyTraitRef(ref bounds) => {
+        TyTraitObject(ref bounds) => {
             walk_list!(visitor, visit_ty_param_bound, bounds);
         }
         TyImplTrait(ref bounds) => {
@@ -665,7 +661,7 @@ pub fn walk_pat<'v, V: Visitor<'v>>(visitor: &mut V, pattern: &'v Pat) {
             walk_list!(visitor, visit_pat, optional_subpattern);
         }
         PatKind::Lit(ref expression) => visitor.visit_expr(expression),
-        PatKind::Range(ref lower_bound, ref upper_bound) => {
+        PatKind::Range(ref lower_bound, ref upper_bound, _) => {
             visitor.visit_expr(lower_bound);
             visitor.visit_expr(upper_bound)
         }
@@ -740,12 +736,12 @@ pub fn walk_where_predicate<'v, V: Visitor<'v>>(
             walk_list!(visitor, visit_lifetime, bounds);
         }
         &WherePredicate::EqPredicate(WhereEqPredicate{id,
-                                                      ref path,
-                                                      ref ty,
+                                                      ref lhs_ty,
+                                                      ref rhs_ty,
                                                       ..}) => {
             visitor.visit_id(id);
-            visitor.visit_path(path, id);
-            visitor.visit_ty(ty);
+            visitor.visit_ty(lhs_ty);
+            visitor.visit_ty(rhs_ty);
         }
     }
 }
@@ -1089,13 +1085,13 @@ pub fn add(&mut self, id: NodeId) {
 }
 
 
-pub struct IdRangeComputingVisitor<'a, 'ast: 'a> {
+pub struct IdRangeComputingVisitor<'a, 'hir: 'a> {
     result: IdRange,
-    map: &'a map::Map<'ast>,
+    map: &'a map::Map<'hir>,
 }
 
-impl<'a, 'ast> IdRangeComputingVisitor<'a, 'ast> {
-    pub fn new(map: &'a map::Map<'ast>) -> IdRangeComputingVisitor<'a, 'ast> {
+impl<'a, 'hir> IdRangeComputingVisitor<'a, 'hir> {
+    pub fn new(map: &'a map::Map<'hir>) -> IdRangeComputingVisitor<'a, 'hir> {
         IdRangeComputingVisitor { result: IdRange::max(), map: map }
     }
 
@@ -1104,8 +1100,8 @@ pub fn result(&self) -> IdRange {
     }
 }
 
-impl<'a, 'ast> Visitor<'ast> for IdRangeComputingVisitor<'a, 'ast> {
-    fn nested_visit_map<'this>(&'this mut self) -> NestedVisitorMap<'this, 'ast> {
+impl<'a, 'hir> Visitor<'hir> for IdRangeComputingVisitor<'a, 'hir> {
+    fn nested_visit_map<'this>(&'this mut self) -> NestedVisitorMap<'this, 'hir> {
         NestedVisitorMap::OnlyBodies(&self.map)
     }