about summary refs log tree commit diff
path: root/src/libfuzzer/fuzzer.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libfuzzer/fuzzer.rs')
-rw-r--r--src/libfuzzer/fuzzer.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libfuzzer/fuzzer.rs b/src/libfuzzer/fuzzer.rs
index 86e45179cb0..652837909b1 100644
--- a/src/libfuzzer/fuzzer.rs
+++ b/src/libfuzzer/fuzzer.rs
@@ -10,6 +10,7 @@ use syntax::diagnostic;
 enum test_mode { tm_converge, tm_run, }
 type context = { mode: test_mode }; // + rng
 
+#[cfg(stage0)]
 impl test_mode : cmp::Eq {
     pure fn eq(other: &test_mode) -> bool {
         (self as uint) == ((*other) as uint)
@@ -17,6 +18,15 @@ impl test_mode : cmp::Eq {
     pure fn ne(other: &test_mode) -> bool { !self.eq(other) }
 }
 
+#[cfg(stage1)]
+#[cfg(stage2)]
+impl test_mode : cmp::Eq {
+    pure fn eq(&self, other: &test_mode) -> bool {
+        ((*self) as uint) == ((*other) as uint)
+    }
+    pure fn ne(&self, other: &test_mode) -> bool { !(*self).eq(other) }
+}
+
 fn write_file(filename: &Path, content: ~str) {
     result::get(
         &io::file_writer(filename, ~[io::Create, io::Truncate]))