]> git.lizzy.rs Git - rust.git/commitdiff
Fix crash with idents from different contexts
authorManish Goregaokar <manishsmail@gmail.com>
Sun, 2 Aug 2015 15:29:12 +0000 (20:59 +0530)
committerManish Goregaokar <manishsmail@gmail.com>
Sun, 2 Aug 2015 15:29:12 +0000 (20:59 +0530)
Cargo.toml
src/eq_op.rs

index d0955c313e9d061ac61af7873b3d17897dfedbff..c94e1b385268b382c17e3bea0b9b3c41e42d0906 100644 (file)
@@ -1,6 +1,6 @@
 [package]
 name = "clippy"
-version = "0.0.7"
+version = "0.0.8"
 authors = [
        "Manish Goregaokar <manishsmail@gmail.com>",
        "Andre Bogus <bogusandre@gmail.com>"
index 10dbca2cf3c2146d2b58ff203c01a5e7282e4339..bd9787bd51c707720567ef4b9608783a5adbb276 100644 (file)
@@ -72,7 +72,13 @@ fn is_exps_equal(left : &[P<Expr>], right : &[P<Expr>]) -> bool {
 }
 
 fn is_path_equal(left : &Path, right : &Path) -> bool {
-       left.global == right.global && left.segments == right.segments
+    // The == of idents doesn't work with different contexts,
+    // we have to be explicit about hygeine
+       left.global == right.global
+    && left.segments.iter().zip(right.segments.iter())
+           .all( |(l,r)| l.identifier.name == r.identifier.name
+                         && l.identifier.ctxt == r.identifier.ctxt
+                         && l.parameters == r.parameters)
 }
 
 fn is_qself_equal(left : &QSelf, right : &QSelf) -> bool {