Skip to content
Myr

Remove AsDynError trait

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by David Tolnay · committed by David Tolnay · parent 8a43c53 · Browse files · 2 files+0 added−32 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+0 added−32 removed

  • other:+0 added−32 removed

2 files+0 added−32 removed

deleted:src/as_dyn_error.rs-30 removed
1use std::error::Error as StdError;23use crate::Error;45/// View error as a `&dyn std::error::Error`.6pub trait AsDynError {7 /// View type as an error object.8 fn as_dyn_error(&self) -> &(dyn StdError + Send + Sync + 'static);9}1011impl<T> AsDynError for T12where13 T: StdError + Send + Sync + 'static,14{15 fn as_dyn_error(&self) -> &(dyn StdError + Send + Sync + 'static) {16 self17 }18}1920impl AsDynError for dyn StdError + Send + Sync + 'static {21 fn as_dyn_error(&self) -> &(dyn StdError + Send + Sync + 'static) {22 self23 }24}2526impl AsDynError for Error {27 fn as_dyn_error(&self) -> &(dyn StdError + Send + Sync + 'static) {28 &**self29 }30}
modified:src/lib.rs-2 removed
1#![feature(backtrace)]23mod as_dyn_error;3mod context;4mod error;56#[cfg(not(feature = "std"))]7compile_error!("no_std support is not implemented yet");810pub use crate::as_dyn_error::AsDynError;9pub use crate::context::Context;10pub use crate::error::{Chain, Error};1112/// `Result<T, Error>`
32 unmodified lines