File tree Expand file tree Collapse file tree 5 files changed +18
-12
lines changed Expand file tree Collapse file tree 5 files changed +18
-12
lines changed Original file line number Diff line number Diff line change 8282#![ stable( feature = "rust1" , since = "1.0.0" ) ]
8383
8484use prelude:: * ;
85- use fmt:: Display ;
85+ use fmt:: { Debug , Display } ;
8686
8787/// Base functionality for all errors in Rust.
88- #[ unstable( feature = "core" ,
89- reason = "the exact API of this trait may change" ) ]
90- pub trait Error : Display {
91- /// A short description of the error; usually a static string.
88+ #[ stable( feature = "rust1" , since = "1.0.0" ) ]
89+ pub trait Error : Debug + Display + Send {
90+ /// A short description of the error.
91+ ///
92+ /// The description should not contain newlines or sentence-ending
93+ /// punctuation, to facilitate embedding in larger user-facing
94+ /// strings.
95+ #[ stable( feature = "rust1" , since = "1.0.0" ) ]
9296 fn description ( & self ) -> & str ;
9397
9498 /// The lower-level cause of this error, if any.
99+ #[ stable( feature = "rust1" , since = "1.0.0" ) ]
95100 fn cause ( & self ) -> Option < & Error > { None }
96101}
97102
Original file line number Diff line number Diff line change @@ -258,7 +258,7 @@ impl<W> FromError<IntoInnerError<W>> for Error {
258258}
259259
260260#[ stable( feature = "rust1" , since = "1.0.0" ) ]
261- impl < W > error:: Error for IntoInnerError < W > {
261+ impl < W : Send + fmt :: Debug > error:: Error for IntoInnerError < W > {
262262 fn description ( & self ) -> & str {
263263 error:: Error :: description ( self . error ( ) )
264264 }
Original file line number Diff line number Diff line change @@ -977,7 +977,7 @@ impl<T> fmt::Display for SendError<T> {
977977}
978978
979979#[ stable( feature = "rust1" , since = "1.0.0" ) ]
980- impl < T > error:: Error for SendError < T > {
980+ impl < T : Send > error:: Error for SendError < T > {
981981
982982 fn description ( & self ) -> & str {
983983 "sending on a closed channel"
@@ -1013,7 +1013,7 @@ impl<T> fmt::Display for TrySendError<T> {
10131013}
10141014
10151015#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1016- impl < T > error:: Error for TrySendError < T > {
1016+ impl < T : Send > error:: Error for TrySendError < T > {
10171017
10181018 fn description ( & self ) -> & str {
10191019 match * self {
Original file line number Diff line number Diff line change @@ -105,11 +105,11 @@ impl<T> fmt::Debug for PoisonError<T> {
105105#[ stable( feature = "rust1" , since = "1.0.0" ) ]
106106impl < T > fmt:: Display for PoisonError < T > {
107107 fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
108- self . description ( ) . fmt ( f)
108+ "poisoned lock: another task failed inside" . fmt ( f)
109109 }
110110}
111111
112- impl < T > Error for PoisonError < T > {
112+ impl < T : Send > Error for PoisonError < T > {
113113 fn description ( & self ) -> & str {
114114 "poisoned lock: another task failed inside"
115115 }
@@ -161,13 +161,13 @@ impl<T> fmt::Debug for TryLockError<T> {
161161}
162162
163163#[ stable( feature = "rust1" , since = "1.0.0" ) ]
164- impl < T > fmt:: Display for TryLockError < T > {
164+ impl < T : Send > fmt:: Display for TryLockError < T > {
165165 fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
166166 self . description ( ) . fmt ( f)
167167 }
168168}
169169
170- impl < T > Error for TryLockError < T > {
170+ impl < T : Send > Error for TryLockError < T > {
171171 fn description ( & self ) -> & str {
172172 match * self {
173173 TryLockError :: Poisoned ( ref p) => p. description ( ) ,
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ pub type CommandError = Box<Error + 'static>;
2020pub type CommandResult < T > = Result < T , CommandError > ;
2121
2222pub fn err ( s : & str ) -> CliError {
23+ #[ derive( Debug ) ]
2324 struct E ( String ) ;
2425
2526 impl Error for E {
You can’t perform that action at this time.
0 commit comments