1- #![ deny( missing_docs) ]
1+ // #![deny(missing_docs)]
22#![ allow( unknown_lints) ] // to be removed when unused_doc_comments lints is merged
33#![ doc( html_root_url = "https://docs.rs/error-chain/0.11.0-rc.2" ) ]
44
@@ -563,13 +563,16 @@ pub trait ChainedError<S: ?Sized>: error::Error + Send + 'static {
563563 type ErrorKind ;
564564
565565 /// Constructs an error from a kind, and generates a backtrace.
566- fn from_kind ( kind : Self :: ErrorKind ) -> Self where Self : Sized ;
566+ fn from_kind ( kind : Self :: ErrorKind ) -> Self
567+ where
568+ Self : Sized ;
567569
568570 /// Constructs a chained error from another error and a kind, and generates a backtrace.
569571 fn with_chain < E , K > ( error : E , kind : K ) -> Self
570- where Self : Sized ,
571- E : ToError + :: std:: error:: Error + Send + ' static ,
572- K : Into < Self :: ErrorKind > ;
572+ where
573+ Self : Sized ,
574+ E : ToError + :: std:: error:: Error + Send + ' static ,
575+ K : Into < Self :: ErrorKind > ;
573576
574577 /// Returns the kind of the error.
575578 fn kind ( & self ) -> & Self :: ErrorKind ;
@@ -584,18 +587,21 @@ pub trait ChainedError<S: ?Sized>: error::Error + Send + 'static {
584587 /// context of this error.
585588 ///
586589 /// The full cause chain and backtrace, if present, will be printed.
587- fn display_chain < ' a > ( & ' a self ) -> DisplayChain < ' a , Self > {
590+ fn display_chain < ' a > ( & ' a self ) -> DisplayChain < ' a , Self , S > {
588591 DisplayChain ( self , PhantomData )
589592 }
590593
591594 /// Extends the error chain with a new entry.
592595 fn chain_err < F , EK > ( self , error : F ) -> Self
593- where F : FnOnce ( ) -> EK ,
594- EK : Into < Self :: ErrorKind > ;
596+ where
597+ F : FnOnce ( ) -> EK ,
598+ EK : Into < Self :: ErrorKind > ;
595599
596600 /// Creates an error from its parts.
597601 #[ doc( hidden) ]
598- fn new ( kind : Self :: ErrorKind , state : State < S > ) -> Self where Self : Sized ;
602+ fn new ( kind : Self :: ErrorKind , state : State < S > ) -> Self
603+ where
604+ Self : Sized ;
599605
600606 /// Returns the first known backtrace, either from its State or from one
601607 /// of the errors from `foreign_links`.
@@ -608,19 +614,19 @@ pub trait ToError {
608614 fn to_error ( & self ) -> & ( error:: Error + Send + ' static ) ;
609615}
610616
617+ impl < T : ?Sized + ToError + error:: Error + Send + ' static > ToError for Box < T > {
618+ fn to_error ( & self ) -> & ( error:: Error + Send + ' static ) {
619+ self
620+ }
621+ }
622+
611623/// A struct which formats an error for output.
612624#[ derive( Debug ) ]
613- <<<<<<< HEAD
614- pub struct DisplayChain < ' a , T : ' a + ?Sized > ( & ' a T ) ;
615-
616- impl <' a , T > fmt:: Display for DisplayChain < ' a , T >
617- where T : ChainedError
618- =======
619- pub struct Display < ' a , T : ' a + ?Sized , S : ?Sized > ( & ' a T , PhantomData < S > ) ;
625+ pub struct DisplayChain < ' a , T : ' a + ?Sized , S : ?Sized > ( & ' a T , PhantomData < S > ) ;
620626
621- impl <' a , T , S > fmt:: Display for Display < ' a , T , S >
622- where T : ChainedError < S >
623- >>>>>>> Add generic parameter to some types ( errors can now add trait bounds )
627+ impl < ' a , T , S > fmt:: Display for DisplayChain < ' a , T , S >
628+ where
629+ T : ChainedError < S > ,
624630{
625631 fn fmt ( & self , fmt : & mut fmt:: Formatter ) -> fmt:: Result {
626632 // Keep `try!` for 1.10 support
@@ -665,7 +671,8 @@ impl<T: ?Sized> Default for State<T> {
665671}
666672
667673impl < T > State < T >
668- where T : ToError + ?Sized
674+ where
675+ T : ToError + ?Sized ,
669676{
670677 /// Creates a new State type
671678 #[ cfg( feature = "backtrace" ) ]
0 commit comments