about summary refs log tree commit diff
path: root/src/libstd/rt/task.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstd/rt/task.rs')
-rw-r--r--src/libstd/rt/task.rs39
1 files changed, 4 insertions, 35 deletions
diff --git a/src/libstd/rt/task.rs b/src/libstd/rt/task.rs
index 10b4672df05..7c08dabf0bd 100644
--- a/src/libstd/rt/task.rs
+++ b/src/libstd/rt/task.rs
@@ -25,7 +25,7 @@ pub struct Task {
     gc: GarbageCollector,
     storage: LocalStorage,
     logger: StdErrLogger,
-    unwinder: Option<Unwinder>,
+    unwinder: Unwinder,
     destroyed: bool
 }
 
@@ -43,18 +43,7 @@ impl Task {
             gc: GarbageCollector,
             storage: LocalStorage(ptr::null(), None),
             logger: StdErrLogger,
-            unwinder: Some(Unwinder { unwinding: false }),
-            destroyed: false
-        }
-    }
-
-    pub fn new_root_without_unwinding() -> Task {
-        Task {
-            heap: LocalHeap::new(),
-            gc: GarbageCollector,
-            storage: LocalStorage(ptr::null(), None),
-            logger: StdErrLogger,
-            unwinder: None,
+            unwinder: Unwinder { unwinding: false },
             destroyed: false
         }
     }
@@ -65,18 +54,7 @@ impl Task {
             gc: GarbageCollector,
             storage: LocalStorage(ptr::null(), None),
             logger: StdErrLogger,
-            unwinder: Some(Unwinder { unwinding: false }),
-            destroyed: false
-        }
-    }
-
-    pub fn new_child_without_unwinding(&mut self) -> Task {
-        Task {
-            heap: LocalHeap::new(),
-            gc: GarbageCollector,
-            storage: LocalStorage(ptr::null(), None),
-            logger: StdErrLogger,
-            unwinder: None,
+            unwinder: Unwinder { unwinding: false },
             destroyed: false
         }
     }
@@ -88,16 +66,7 @@ impl Task {
             assert!(ptr::ref_eq(task, self));
         }
 
-        match self.unwinder {
-            Some(ref mut unwinder) => {
-                // If there's an unwinder then set up the catch block
-                unwinder.try(f);
-            }
-            None => {
-                // Otherwise, just run the body
-                f()
-            }
-        }
+        self.unwinder.try(f);
         self.destroy();
     }