Fix crash with idents from different contexts
This commit is contained in:
parent
de5ccdfab6
commit
6ebb9b1551
|
@ -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>"
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue