Skip to content

Commit 1d6af42

Browse files
committed
---
yaml --- r: 79440 b: refs/heads/snap-stage3 c: 77c96d7 h: refs/heads/master v: v3
1 parent 32a2dae commit 1d6af42

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
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 124eb2119c78651cfaaa7a046a101fa2e20f83ca
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 6e3b2ab44d9c03fb7aa8e8b94e711c197de3d337
4+
refs/heads/snap-stage3: 77c96d754e3a5d4b8dd59269b0cb0324350ccbec
55
refs/heads/try: ac820906c0e53eab79a98ee64f7231f57c3887b4
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/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)