Fix crash with idents from different contexts

This commit is contained in:
Manish Goregaokar 2015-08-02 20:59:12 +05:30
parent de5ccdfab6
commit 6ebb9b1551
2 changed files with 8 additions and 2 deletions

View 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>"

View 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 {