]> git.lizzy.rs Git - rust.git/blobdiff - src/librustrt/unwind.rs
Register new snapshots
[rust.git] / src / librustrt / unwind.rs
index aebed5a8829c5290c3acc2965ee623934c7086c7..86e2c3f3db9b0e381a0a9a43659ecfcd4beb8943 100644 (file)
 
 pub struct Unwinder {
     unwinding: bool,
-    cause: Option<Box<Any:Send>>
+    cause: Option<Box<Any + Send>>
 }
 
 struct Exception {
     uwe: uw::_Unwind_Exception,
-    cause: Option<Box<Any:Send>>,
+    cause: Option<Box<Any + Send>>,
 }
 
-pub type Callback = fn(msg: &Any:Send, file: &'static str, line: uint);
+pub type Callback = fn(msg: &Any + Send, file: &'static str, line: uint);
 
 // Variables used for invoking callbacks when a task starts to unwind.
 //
@@ -148,7 +148,7 @@ pub fn result(&mut self) -> Result {
 ///   guaranteed that a rust task is in place when invoking this function.
 ///   Unwinding twice can lead to resource leaks where some destructors are not
 ///   run.
-pub unsafe fn try(f: ||) -> ::core::result::Result<(), Box<Any:Send>> {
+pub unsafe fn try(f: ||) -> ::core::result::Result<(), Box<Any + Send>> {
     let closure: Closure = mem::transmute(f);
     let ep = rust_try(try_fn, closure.code as *c_void,
                       closure.env as *c_void);
@@ -187,7 +187,7 @@ fn rust_try(f: extern "C" fn(*c_void, *c_void),
 // An uninlined, unmangled function upon which to slap yer breakpoints
 #[inline(never)]
 #[no_mangle]
-fn rust_fail(cause: Box<Any:Send>) -> ! {
+fn rust_fail(cause: Box<Any + Send>) -> ! {
     rtdebug!("begin_unwind()");
 
     unsafe {
@@ -400,7 +400,7 @@ pub fn begin_unwind<M: Any + Send>(msg: M, file: &'static str, line: uint) -> !
 /// Do this split took the LLVM IR line counts of `fn main() { fail!()
 /// }` from ~1900/3700 (-O/no opts) to 180/590.
 #[inline(never)] #[cold] // this is the slow path, please never inline this
-fn begin_unwind_inner(msg: Box<Any:Send>,
+fn begin_unwind_inner(msg: Box<Any + Send>,
                       file: &'static str,
                       line: uint) -> ! {
     // First, invoke call the user-defined callbacks triggered on task failure.