From fa8e71a8257f4226ab532d4bf268d3ecbfa98eb4 Mon Sep 17 00:00:00 2001 From: Marvin Löbel Date: Fri, 11 Oct 2013 23:20:34 +0200 Subject: Allow fail messages to be caught, and introduce the Any trait Some code cleanup, sorting of import blocks Removed std::unstable::UnsafeArc's use of Either Added run-fail tests for the new FailWithCause impls Changed future_result and try to return Result<(), ~Any>. - Internally, there is an enum of possible fail messages passend around. - In case of linked failure or a string message, the ~Any gets lazyly allocated in future_results recv method. - For that, future result now returns a wrapper around a Port. - Moved and renamed task::TaskResult into rt::task::UnwindResult and made it an internal enum. - Introduced a replacement typedef `type TaskResult = Result<(), ~Any>`. --- src/libstd/rt/io/option.rs | 2 +- src/libstd/rt/io/signal.rs | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src/libstd/rt/io') diff --git a/src/libstd/rt/io/option.rs b/src/libstd/rt/io/option.rs index 52699964b62..234b46458b4 100644 --- a/src/libstd/rt/io/option.rs +++ b/src/libstd/rt/io/option.rs @@ -107,7 +107,7 @@ mod test { use option::*; use super::super::mem::*; use rt::test::*; - use super::super::{PreviousIoError, io_error, io_error}; + use super::super::{PreviousIoError, io_error}; #[test] fn test_option_writer() { diff --git a/src/libstd/rt/io/signal.rs b/src/libstd/rt/io/signal.rs index d2266c8d5d6..4c6c675df03 100644 --- a/src/libstd/rt/io/signal.rs +++ b/src/libstd/rt/io/signal.rs @@ -145,10 +145,10 @@ impl Listener { #[cfg(test)] mod test { + use super::*; + use libc; use rt::io::timer; - use rt::io; - use super::*; // kill is only available on Unixes #[cfg(unix)] @@ -206,6 +206,7 @@ mod test { #[cfg(windows)] #[test] fn test_io_signal_invalid_signum() { + use rt::io; let mut s = Listener::new(); let mut called = false; do io::io_error::cond.trap(|_| { -- cgit 1.4.1-3-g733a5