about summary refs log tree commit diff
path: root/src/libstd/lib.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-11-03 03:57:18 +0000
committerbors <bors@rust-lang.org>2014-11-03 03:57:18 +0000
commitff50f24feb512075f3fcf9fc2801e4c853ff9316 (patch)
tree9842337cf63e33f73bed8ba4ee681a6a3e9549f5 /src/libstd/lib.rs
parentdcc5c3b31b294a19c369e7b1926528610230686d (diff)
parent38e0745e3f5e6c772c973c1d0b73abb0b20faba0 (diff)
downloadrust-ff50f24feb512075f3fcf9fc2801e4c853ff9316.tar.gz
rust-ff50f24feb512075f3fcf9fc2801e4c853ff9316.zip
auto merge of #17753 : aturon/rust/error-interop, r=alexcrichton
This PR:

* Adds the error interoperation traits (`Error` and `FromError`) to a new module, `std::error`, as per [RFC 70](https://github.com/rust-lang/rfcs/blob/master/active/0070-error-chaining.md). Note that this module must live in `std` in order to refer to `String`.

    Note that, until multidispatch lands, the `FromError` trait cannot be
usefully implemented outside of the blanket impl given here.

* Incorporates `std::error::FromError` into the `try!` macro.

* Implements `Error` for most existing error enumerations.

Closes #17747
Diffstat (limited to 'src/libstd/lib.rs')
-rw-r--r--src/libstd/lib.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs
index 67080f4551f..f10a1d5e5ed 100644
--- a/src/libstd/lib.rs
+++ b/src/libstd/lib.rs
@@ -218,6 +218,7 @@ pub mod time;
 
 /* Common traits */
 
+pub mod error;
 pub mod from_str;
 pub mod num;
 pub mod to_string;
@@ -257,6 +258,7 @@ mod std {
     pub use hash;
 
     pub use comm; // used for select!()
+    pub use error; // used for try!()
     pub use fmt; // used for any formatting strings
     pub use io; // used for println!()
     pub use local_data; // used for local_data_key!()