about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2012-09-07 18:53:14 -0700
committerPatrick Walton <pcwalton@mimiga.net>2012-09-10 12:48:42 -0700
commit22b875770543ec1fe93cfb35fd07c692db5675e2 (patch)
tree62004747db05cf0fb7d82b85133210c67e2c7bb3 /src/libsyntax/parse
parent9a15c50f6c3cec5320ef91f000142af0367890a4 (diff)
downloadrust-22b875770543ec1fe93cfb35fd07c692db5675e2.tar.gz
rust-22b875770543ec1fe93cfb35fd07c692db5675e2.zip
rustc: Make shape-based compare glue never called for comparison operators.
Only called for string patterns.
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/comments.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/libsyntax/parse/comments.rs b/src/libsyntax/parse/comments.rs
index b85262cb79d..7fcf7a032dc 100644
--- a/src/libsyntax/parse/comments.rs
+++ b/src/libsyntax/parse/comments.rs
@@ -17,6 +17,15 @@ enum cmnt_style {
     blank_line, // Just a manual blank line "\n\n", for layout
 }
 
+impl cmnt_style : cmp::Eq {
+    pure fn eq(&&other: cmnt_style) -> bool {
+        (self as uint) == (other as uint)
+    }
+    pure fn ne(&&other: cmnt_style) -> bool {
+        (self as uint) != (other as uint)
+    }
+}
+
 type cmnt = {style: cmnt_style, lines: ~[~str], pos: uint};
 
 fn is_doc_comment(s: ~str) -> bool {