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>`.
This commit is contained in:
Marvin Löbel 2013-10-11 23:20:34 +02:00
parent cb5b21eba7
commit fa8e71a825
24 changed files with 913 additions and 215 deletions

View file

@ -640,9 +640,8 @@ fn test_install_invalid() {
pkgid.clone());
ctxt.install(pkg_src, &WhatToBuild::new(MaybeCustom, Everything));
};
// Not the best test -- doesn't test that we failed in the right way.
// Best we can do for now.
assert!(result == Err(()));
assert!(result.unwrap_err()
.to_str().contains("supplied path for package dir does not exist"));
}
#[test]