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.
This commit is contained in:
parent
82a8a5ebb3
commit
949443eff6
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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!())
|
||||
);
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue