45
45
//! * Conversions between error types are done in an automatic and
46
46
//! consistent way - `From` conversion behavior is never specified
47
47
//! explicitly.
48
- //! * Errors implement `Sync` and ` Send` .
48
+ //! * Errors implement Send.
49
49
//! * Errors can carry backtraces.
50
50
//!
51
51
//! Similar to other libraries like [error-type] and [quick-error],
61
61
//! * Instead of defining the custom `Error` type as an enum, it is a
62
62
//! struct containing an `ErrorKind` (which defines the
63
63
//! `description` and `display` methods for the error), an opaque,
64
- //! optional, boxed `std::error::Error + Sync + Send + 'static` object
64
+ //! optional, boxed `std::error::Error + Send + 'static` object
65
65
//! (which defines the `cause`, and establishes the links in the
66
66
//! error chain), and a `Backtrace`.
67
67
//! * The macro also defines a `ResultExt` trait that defines a
68
- //! `chain_err` method. This method on all `std::error::Error + Sync + Send + 'static`
68
+ //! `chain_err` method. This method on all `std::error::Error + Send + 'static`
69
69
//! types extends the error chain by boxing the current
70
70
//! error into an opaque object and putting it inside a new concrete
71
71
//! error.
86
86
//! requiring an `Into` or `From` conversion; as well as slightly
87
87
//! more cumbersome to match on errors with another layer of types
88
88
//! to match.
89
- //! * Because the error type contains `std::error::Error + Sync + Send + 'static` objects,
89
+ //! * Because the error type contains `std::error::Error + Send + 'static` objects,
90
90
//! it can't implement `PartialEq` for easy comparisons.
91
91
//!
92
92
//! ## Declaring error types
261
261
//! ```
262
262
//!
263
263
//! `chain_err` can be called on any `Result` type where the contained
264
- //! error type implements `std::error::Error + Sync + Send + 'static`. If
264
+ //! error type implements `std::error::Error + Send + 'static`. If
265
265
//! the `Result` is an `Err` then `chain_err` evaluates the closure,
266
266
//! which returns *some type that can be converted to `ErrorKind`*,
267
267
//! boxes the original error to store as the cause, then returns a new
@@ -417,7 +417,7 @@ pub fn make_backtrace() -> Option<Arc<Backtrace>> {
417
417
418
418
/// This trait is implemented on all the errors generated by the `error_chain`
419
419
/// macro.
420
- pub trait ChainedError : error:: Error + Sync + Send + ' static {
420
+ pub trait ChainedError : error:: Error + Send + ' static {
421
421
/// Associated kind type.
422
422
type ErrorKind ;
423
423
@@ -449,7 +449,7 @@ pub trait ChainedError: error::Error + Sync + Send + 'static {
449
449
/// of the errors from `foreign_links`.
450
450
#[ cfg( feature = "backtrace" ) ]
451
451
#[ doc( hidden) ]
452
- fn extract_backtrace ( e : & ( error:: Error + Sync + Send + ' static ) ) -> Option < Arc < Backtrace > >
452
+ fn extract_backtrace ( e : & ( error:: Error + Send + ' static ) ) -> Option < Arc < Backtrace > >
453
453
where Self : Sized ;
454
454
}
455
455
@@ -480,7 +480,7 @@ impl<'a, T> fmt::Display for Display<'a, T>
480
480
#[ doc( hidden) ]
481
481
pub struct State {
482
482
/// Next error in the error chain.
483
- pub next_error : Option < Box < error:: Error + Sync + Send > > ,
483
+ pub next_error : Option < Box < error:: Error + Send > > ,
484
484
/// Backtrace for the current error.
485
485
#[ cfg( feature = "backtrace" ) ]
486
486
pub backtrace : Option < Arc < Backtrace > > ,
@@ -504,7 +504,7 @@ impl Default for State {
504
504
impl State {
505
505
/// Creates a new State type
506
506
#[ cfg( feature = "backtrace" ) ]
507
- pub fn new < CE : ChainedError > ( e : Box < error:: Error + Sync + Send > ) -> State {
507
+ pub fn new < CE : ChainedError > ( e : Box < error:: Error + Send > ) -> State {
508
508
let backtrace = CE :: extract_backtrace ( & * e) . or_else ( make_backtrace) ;
509
509
State {
510
510
next_error : Some ( e) ,
@@ -514,7 +514,7 @@ impl State {
514
514
515
515
/// Creates a new State type
516
516
#[ cfg( not( feature = "backtrace" ) ) ]
517
- pub fn new < CE : ChainedError > ( e : Box < error:: Error + Sync + Send > ) -> State {
517
+ pub fn new < CE : ChainedError > ( e : Box < error:: Error + Send > ) -> State {
518
518
State { next_error : Some ( e) }
519
519
}
520
520
0 commit comments