diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-05-12 21:23:13 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-05-13 23:59:03 -0700 |
| commit | 949443eff640ede205502547ea04a4dd350b255f (patch) | |
| tree | 9ee4a1a668d36ef0bbc6e5c617d1e7d7d3e752d9 | |
| parent | 82a8a5ebb3b3c34cd135da511641a9df28e2c30e (diff) | |
core: Allow using failure outside of libcore
Due to our excellent macro hygiene, this involves having a global path and a hidden module in libcore itself.
| -rw-r--r-- | src/libcore/failure.rs | 2 | ||||
| -rw-r--r-- | src/libcore/lib.rs | 7 | ||||
| -rw-r--r-- | src/libcore/macros.rs | 2 |
3 files changed, 7 insertions, 4 deletions
diff --git a/src/libcore/failure.rs b/src/libcore/failure.rs index 2296e663033..8a28f7b1392 100644 --- a/src/libcore/failure.rs +++ b/src/libcore/failure.rs @@ -10,7 +10,7 @@ //! Failure support for libcore -#![allow(dead_code)] +#![allow(dead_code, missing_doc)] #[cfg(not(test))] use str::raw::c_str_to_static_slice; diff --git a/src/libcore/lib.rs b/src/libcore/lib.rs index 490e499db37..4eab7e9d45d 100644 --- a/src/libcore/lib.rs +++ b/src/libcore/lib.rs @@ -106,6 +106,7 @@ pub mod atomics; pub mod bool; pub mod cell; pub mod char; +pub mod failure; pub mod finally; pub mod iter; pub mod option; @@ -118,13 +119,15 @@ pub mod tuple; #[cfg(stage0, not(test))] pub mod owned; -mod failure; - // FIXME: this module should not exist. Once owned allocations are no longer a // language type, this module can move outside to the owned allocation // crate. mod should_not_exist; +mod core { + pub use failure; +} + mod std { pub use clone; pub use cmp; diff --git a/src/libcore/macros.rs b/src/libcore/macros.rs index 50d5cd81ba0..69be68a34a1 100644 --- a/src/libcore/macros.rs +++ b/src/libcore/macros.rs @@ -17,7 +17,7 @@ macro_rules! fail( fail!("explicit failure") ); ($msg:expr) => ( - ::failure::begin_unwind($msg, file!(), line!()) + ::core::failure::begin_unwind($msg, file!(), line!()) ); ) |
