Export std error type so downstream doesn't need "std" feature

This commit is contained in:
David Tolnay
2019-09-04 19:15:00 -07:00
parent 4cea81f93f
commit c083cfd65e
4 changed files with 67 additions and 2 deletions
+8 -1
View File
@@ -114,6 +114,13 @@ mod impossible;
pub use self::impossible::Impossible;
#[cfg(feature = "std")]
#[doc(no_inline)]
pub use std::error::Error as StdError;
#[cfg(not(feature = "std"))]
#[doc(no_inline)]
pub use std_error::Error as StdError;
////////////////////////////////////////////////////////////////////////////////
macro_rules! declare_error_trait {
@@ -172,7 +179,7 @@ macro_rules! declare_error_trait {
}
#[cfg(feature = "std")]
declare_error_trait!(Error: Sized + error::Error);
declare_error_trait!(Error: Sized + StdError);
#[cfg(not(feature = "std"))]
declare_error_trait!(Error: Sized + Debug + Display);