about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2013-05-06 19:29:04 -0700
committerPatrick Walton <pcwalton@mimiga.net>2013-05-08 17:04:00 -0700
commit278b487cabcbe52b301a8023cd1362045b1a7132 (patch)
treed72884e73791fcb1dc015db22e92569764ebae6f /src/libcore
parentdb4573a7760bd2014b2eca2537b6af15a9803e3d (diff)
downloadrust-278b487cabcbe52b301a8023cd1362045b1a7132.tar.gz
rust-278b487cabcbe52b301a8023cd1362045b1a7132.zip
test: Fix tests and the pipe compiler
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/repr.rs68
-rw-r--r--src/libcore/task/mod.rs2
2 files changed, 21 insertions, 49 deletions
diff --git a/src/libcore/repr.rs b/src/libcore/repr.rs
index b75ac60ff28..c7e20d2b21f 100644
--- a/src/libcore/repr.rs
+++ b/src/libcore/repr.rs
@@ -448,10 +448,15 @@ impl TyVisitor for ReprVisitor {
         true
     }
 
-    fn visit_enter_enum(&self, _n_variants: uint,
+    fn visit_enter_enum(&self,
+                        _n_variants: uint,
                         get_disr: extern unsafe fn(ptr: *Opaque) -> int,
-                        _sz: uint, _align: uint) -> bool {
-        let disr = unsafe { get_disr(transmute(self.ptr)) };
+                        _sz: uint,
+                        _align: uint) -> bool {
+        let var_stk: &mut ~[VariantState] = self.var_stk;
+        let disr = unsafe {
+            get_disr(transmute(*self.ptr))
+        };
         self.var_stk.push(SearchingFor(disr));
         true
     }
@@ -484,31 +489,12 @@ impl TyVisitor for ReprVisitor {
         true
     }
 
-<<<<<<< HEAD
-    fn visit_enum_variant_field(&self, i: uint, _offset: uint, inner: *TyDesc) -> bool {
-        match self.var_stk[vec::uniq_len(&const self.var_stk) - 1] {
-=======
-    #[cfg(stage0)]
-    fn visit_enum_variant_field(&self, i: uint, inner: *TyDesc) -> bool {
-        match self.var_stk[vec::uniq_len(&const *self.var_stk) - 1] {
-            Degenerate | TagMatch => {
-                if i != 0 {
-                    self.writer.write_str(", ");
-                }
-                if ! self.visit_inner(inner) {
-                    return false;
-                }
-            }
-            TagMismatch => ()
-        }
-        true
-    }
-
-    #[cfg(not(stage0))]
-    fn visit_enum_variant_field(&self, i: uint, _: uint, inner: *TyDesc)
+    fn visit_enum_variant_field(&self,
+                                i: uint,
+                                _offset: uint,
+                                inner: *TyDesc)
                                 -> bool {
-        match self.var_stk[vec::uniq_len(&const *self.var_stk) - 1] {
->>>>>>> libcore: Remove mutable fields from repr
+        match self.var_stk[vec::uniq_len(&const self.var_stk) - 1] {
             Matched => {
                 if i != 0 {
                     self.writer.write_str(", ");
@@ -522,26 +508,6 @@ impl TyVisitor for ReprVisitor {
         true
     }
 
-<<<<<<< HEAD
-=======
-    #[cfg(stage0)]
-    fn visit_leave_enum_variant(&self, _variant: uint,
-                                _disr_val: int,
-                                n_fields: uint,
-                                _name: &str) -> bool {
-        match self.var_stk[vec::uniq_len(&const *self.var_stk) - 1] {
-            Degenerate | TagMatch => {
-                if n_fields > 0 {
-                    self.writer.write_char(')');
-                }
-            }
-            TagMismatch => ()
-        }
-        true
-    }
-
-    #[cfg(not(stage0))]
->>>>>>> libcore: Remove mutable fields from repr
     fn visit_leave_enum_variant(&self, _variant: uint,
                                 _disr_val: int,
                                 n_fields: uint,
@@ -557,9 +523,13 @@ impl TyVisitor for ReprVisitor {
         true
     }
 
-    fn visit_leave_enum(&self, _n_variants: uint,
+    fn visit_leave_enum(&self,
+                        _n_variants: uint,
                         _get_disr: extern unsafe fn(ptr: *Opaque) -> int,
-                        _sz: uint, _align: uint) -> bool {
+                        _sz: uint,
+                        _align: uint)
+                        -> bool {
+        let var_stk: &mut ~[VariantState] = self.var_stk;
         match self.var_stk.pop() {
             SearchingFor(*) => fail!(~"enum value matched no variant"),
             _ => true
diff --git a/src/libcore/task/mod.rs b/src/libcore/task/mod.rs
index 24889800175..ce1969a14a1 100644
--- a/src/libcore/task/mod.rs
+++ b/src/libcore/task/mod.rs
@@ -230,12 +230,14 @@ pub impl TaskBuilder {
     /// the child.
     fn supervised(&mut self) {
         self.opts.supervised = true;
+        self.opts.linked = false;
     }
 
     /// Link the child task's and parent task's failures. If either fails, the
     /// other will be killed.
     fn linked(&mut self) {
         self.opts.linked = true;
+        self.opts.supervised = false;
     }
 
     /**