Skip to content

Commit a4ea896

Browse files
committed
---
yaml --- r: 79212 b: refs/heads/auto c: 77c96d7 h: refs/heads/master v: v3
1 parent 9968ec3 commit a4ea896

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: 6e3b2ab44d9c03fb7aa8e8b94e711c197de3d337
16+
refs/heads/auto: 77c96d754e3a5d4b8dd59269b0cb0324350ccbec
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/libsyntax/ast.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,27 @@ use extra::serialize::{Encodable, Decodable, Encoder, Decoder};
2424
// table) and a SyntaxContext to track renaming and
2525
// macro expansion per Flatt et al., "Macros
2626
// That Work Together"
27-
#[deriving(Clone, Eq, IterBytes, ToStr)]
27+
#[deriving(Clone, IterBytes, ToStr)]
2828
pub struct Ident { name: Name, ctxt: SyntaxContext }
2929

3030
impl Ident {
3131
/// Construct an identifier with the given name and an empty context:
3232
pub fn new(name: Name) -> Ident { Ident {name: name, ctxt: EMPTY_CTXT}}
3333
}
3434

35+
impl Eq for Ident {
36+
fn eq(&self, other: &Ident) -> bool {
37+
if (self.ctxt == other.ctxt) {
38+
self.name == other.name
39+
} else {
40+
fail!(fmt!("not allowed to compare these idents: %?, %?", self, other));
41+
}
42+
}
43+
fn ne(&self, other: &Ident) -> bool {
44+
! self.eq(other)
45+
}
46+
}
47+
3548
/// A SyntaxContext represents a chain of macro-expandings
3649
/// and renamings. Each macro expansion corresponds to
3750
/// a fresh uint

0 commit comments

Comments
 (0)