Skip to content

Commit 57f7aba

Browse files
committed
undo cowardly hiding of eq-check
I've reversed my thinking on this restrictive definition of eq after two separate bugs were hidden by commenting it out; it's better to get ICEs than SIGSEGV's, any day. RE-ENABLING ICE MACHINE!
1 parent 42b1694 commit 57f7aba

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

src/libsyntax/ast.rs

+2-13
Original file line numberDiff line numberDiff line change
@@ -28,25 +28,15 @@ use extra::serialize::{Encodable, Decodable, Encoder, Decoder};
2828
// table) and a SyntaxContext to track renaming and
2929
// macro expansion per Flatt et al., "Macros
3030
// That Work Together"
31-
#[deriving(Clone, Eq, IterBytes, ToStr)]
31+
#[deriving(Clone, IterBytes, ToStr)]
3232
pub struct Ident { name: Name, ctxt: SyntaxContext }
3333

3434
impl Ident {
3535
/// Construct an identifier with the given name and an empty context:
3636
pub fn new(name: Name) -> Ident { Ident {name: name, ctxt: EMPTY_CTXT}}
3737
}
3838

39-
// defining eq in this way is a way of guaranteeing that later stages of the
40-
// compiler don't compare identifiers unhygienically. Unfortunately, some tests
41-
// (specifically debuginfo in no-opt) want to do these comparisons, and that
42-
// seems fine. If only I could find a nice way to statically ensure that
43-
// the compiler "proper" never compares identifiers.... I'm leaving this
44-
// code here (commented out) for potential use in debugging. Specifically, if
45-
// there's a bug where "identifiers aren't matching", it may be because
46-
// they should be compared using mtwt_resolve. In such a case, re-enabling this
47-
// code (and disabling deriving(Eq) for Idents) could help to isolate the
48-
// problem
49-
/* impl Eq for Ident {
39+
impl Eq for Ident {
5040
fn eq(&self, other: &Ident) -> bool {
5141
if (self.ctxt == other.ctxt) {
5242
self.name == other.name
@@ -64,7 +54,6 @@ impl Ident {
6454
! self.eq(other)
6555
}
6656
}
67-
*/
6857

6958
/// A SyntaxContext represents a chain of macro-expandings
7059
/// and renamings. Each macro expansion corresponds to

0 commit comments

Comments
 (0)