Skip to content
This repository was archived by the owner on Aug 16, 2021. It is now read-only.

Commit 160706a

Browse files
committed
Revert "Add a Sync bounds to errors (#110)"
This reverts commit 6e5ac7a.
1 parent a67f1ab commit 160706a

File tree

3 files changed

+14
-12
lines changed

3 files changed

+14
-12
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Unreleased
22

3+
- Revert [Add a `Sync` bound to errors](https://github.com/brson/error-chain/pul/110)
4+
35
# 0.8.1
46

57
- Add crates.io categorie.

src/error_chain.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ macro_rules! error_chain_processed {
280280
EK: Into<$error_kind_name>;
281281
}
282282

283-
impl<T, E> $result_ext_name<T, E> for ::std::result::Result<T, E> where E: ::std::error::Error + Sync + Send + 'static {
283+
impl<T, E> $result_ext_name<T, E> for ::std::result::Result<T, E> where E: ::std::error::Error + Send + 'static {
284284
fn chain_err<F, EK>(self, callback: F) -> ::std::result::Result<T, $error_name>
285285
where F: FnOnce() -> EK,
286286
EK: Into<$error_kind_name> {
@@ -373,7 +373,7 @@ macro_rules! impl_extract_backtrace {
373373
($error_name: ident
374374
$error_kind_name: ident
375375
$([$link_error_path: path, $(#[$meta_links: meta])*])*) => {
376-
fn extract_backtrace(e: &(::std::error::Error + Sync + Send + 'static))
376+
fn extract_backtrace(e: &(::std::error::Error + Send + 'static))
377377
-> Option<::std::sync::Arc<$crate::Backtrace>> {
378378
if let Some(e) = e.downcast_ref::<$error_name>() {
379379
return e.1.backtrace.clone();

src/lib.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
//! * Conversions between error types are done in an automatic and
4646
//! consistent way - `From` conversion behavior is never specified
4747
//! explicitly.
48-
//! * Errors implement `Sync` and `Send`.
48+
//! * Errors implement Send.
4949
//! * Errors can carry backtraces.
5050
//!
5151
//! Similar to other libraries like [error-type] and [quick-error],
@@ -61,11 +61,11 @@
6161
//! * Instead of defining the custom `Error` type as an enum, it is a
6262
//! struct containing an `ErrorKind` (which defines the
6363
//! `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
6565
//! (which defines the `cause`, and establishes the links in the
6666
//! error chain), and a `Backtrace`.
6767
//! * 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`
6969
//! types extends the error chain by boxing the current
7070
//! error into an opaque object and putting it inside a new concrete
7171
//! error.
@@ -86,7 +86,7 @@
8686
//! requiring an `Into` or `From` conversion; as well as slightly
8787
//! more cumbersome to match on errors with another layer of types
8888
//! 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,
9090
//! it can't implement `PartialEq` for easy comparisons.
9191
//!
9292
//! ## Declaring error types
@@ -261,7 +261,7 @@
261261
//! ```
262262
//!
263263
//! `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
265265
//! the `Result` is an `Err` then `chain_err` evaluates the closure,
266266
//! which returns *some type that can be converted to `ErrorKind`*,
267267
//! boxes the original error to store as the cause, then returns a new
@@ -417,7 +417,7 @@ pub fn make_backtrace() -> Option<Arc<Backtrace>> {
417417

418418
/// This trait is implemented on all the errors generated by the `error_chain`
419419
/// macro.
420-
pub trait ChainedError: error::Error + Sync + Send + 'static {
420+
pub trait ChainedError: error::Error + Send + 'static {
421421
/// Associated kind type.
422422
type ErrorKind;
423423

@@ -449,7 +449,7 @@ pub trait ChainedError: error::Error + Sync + Send + 'static {
449449
/// of the errors from `foreign_links`.
450450
#[cfg(feature = "backtrace")]
451451
#[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>>
453453
where Self: Sized;
454454
}
455455

@@ -480,7 +480,7 @@ impl<'a, T> fmt::Display for Display<'a, T>
480480
#[doc(hidden)]
481481
pub struct State {
482482
/// 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>>,
484484
/// Backtrace for the current error.
485485
#[cfg(feature = "backtrace")]
486486
pub backtrace: Option<Arc<Backtrace>>,
@@ -504,7 +504,7 @@ impl Default for State {
504504
impl State {
505505
/// Creates a new State type
506506
#[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 {
508508
let backtrace = CE::extract_backtrace(&*e).or_else(make_backtrace);
509509
State {
510510
next_error: Some(e),
@@ -514,7 +514,7 @@ impl State {
514514

515515
/// Creates a new State type
516516
#[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 {
518518
State { next_error: Some(e) }
519519
}
520520

0 commit comments

Comments
 (0)