]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_back/svh.rs
Fill in some missing parts in the default HIR visitor
[rust.git] / src / librustc_back / svh.rs
index 7004e72f8f581685a0533a31f94cf21172ba797d..25b4cfad01ce0e3a43cd2f80c97f7e99b2e39af3 100644 (file)
@@ -177,7 +177,7 @@ enum SawAbiComponent<'a> {
         SawIdent(token::InternedString),
         SawStructDef(token::InternedString),
 
-        SawLifetimeRef(token::InternedString),
+        SawLifetime(token::InternedString),
         SawLifetimeDef(token::InternedString),
 
         SawMod,
@@ -193,7 +193,6 @@ enum SawAbiComponent<'a> {
         SawVariant,
         SawExplicitSelf,
         SawPath,
-        SawOptLifetimeRef,
         SawBlock,
         SawPat,
         SawLocal,
@@ -316,17 +315,6 @@ fn visit_variant(&mut self, v: &Variant, g: &Generics) {
             visit::walk_variant(self, v, g)
         }
 
-        fn visit_opt_lifetime_ref(&mut self, _: Span, l: &Option<Lifetime>) {
-            SawOptLifetimeRef.hash(self.st);
-            // (This is a strange method in the visitor trait, in that
-            // it does not expose a walk function to do the subroutine
-            // calls.)
-            match *l {
-                Some(ref l) => self.visit_lifetime_ref(l),
-                None => ()
-            }
-        }
-
         // All of the remaining methods just record (in the hash
         // SipHasher) that the visitor saw that particular variant
         // (with its payload), and continue walking as the default
@@ -345,8 +333,8 @@ fn visit_name(&mut self, _: Span, name: Name) {
             SawIdent(name.as_str()).hash(self.st);
         }
 
-        fn visit_lifetime_ref(&mut self, l: &Lifetime) {
-            SawLifetimeRef(l.name.as_str()).hash(self.st);
+        fn visit_lifetime(&mut self, l: &Lifetime) {
+            SawLifetime(l.name.as_str()).hash(self.st);
         }
 
         fn visit_lifetime_def(&mut self, l: &LifetimeDef) {