]> git.lizzy.rs Git - rust.git/commitdiff
Hash discriminant of Lifetime::Name
authorxd009642 <danielmckenna93@gmail.com>
Sat, 27 Jul 2019 21:59:46 +0000 (22:59 +0100)
committerxd009642 <danielmckenna93@gmail.com>
Sat, 27 Jul 2019 21:59:46 +0000 (22:59 +0100)
clippy_lints/src/utils/hir_utils.rs

index db7b10c6bacd921bb2bf59063cf1fb27151ba410..64f5f352570bee52e8217a4bcffa780f14fe89e3 100644 (file)
@@ -584,6 +584,7 @@ pub fn hash_guard(&mut self, g: &Guard) {
 
     pub fn hash_lifetime(&mut self, lifetime: &Lifetime) {
         if let LifetimeName::Param(ref name) = lifetime.name {
+            std::mem::discriminant(&name).hash(&mut self.s);
             match name {
                 ParamName::Plain(ref ident) => {
                     ident.name.hash(&mut self.s);
@@ -591,7 +592,7 @@ pub fn hash_lifetime(&mut self, lifetime: &Lifetime) {
                 ParamName::Fresh(ref size) => {
                     size.hash(&mut self.s);
                 },
-                _ => {},
+                ParamName::Error => {},
             }
         }
     }