Uh oh!
There was an error while loading. Please reload this page.
Stabilize the Error trait - #23541
Merged
Merged
Conversation
ContributorAuthor
There was a problem hiding this comment.
To avoid the Send bound on T. (since you're just going to get this text anyway...)
alexcrichton
commented
Mar 20, 2015
Member
@bors: r+ 16009e416580f3c938d1d49c27a4a4d7f4b946cc |
aturon
commented
Mar 20, 2015
ContributorAuthor
@bors: r- I want to put in the |
aturon
commented
Mar 20, 2015
ContributorAuthor
@alexcrichton Updated with |
alexcrichton
commented
Mar 20, 2015
Member
@bors: r+ 8c39218 |
bors
commented
Mar 21, 2015
Collaborator
⌛ Testing commit 8c39218 with merge 0e56d8b... |
bors
commented
Mar 21, 2015
Collaborator
💔 Test failed - auto-mac-64-opt |
This small commit stabilizes the `Error` trait as-is, except that `Send` and `Debug` are added as constraints. The `Send` constraint is because most uses of `Error` will be for trait objects, and by default we would like these objects to be transferrable between threads. The `Debug` constraint is to ensure that e.g. `Box<Error>` is `Debug`, and because types that implement `Display` should certainly implement `Debug` in any case. In the near future we expect to add `Any`-like downcasting features to `Error`, but this is waiting on some additional mechanisms (`Reflect`). It will be added before 1.0 via default methods. [breaking-change]
aturon
commented
Mar 23, 2015
ContributorAuthor
alexcrichton added a commit
to alexcrichton/rust
that referenced
this pull request
Mar 23, 2015
This small commit stabilizes the `Error` trait as-is, except that `Send` and `Debug` are added as constraints. The `Send` constraint is because most uses of `Error` will be for trait objects, and by default we would like these objects to be transferrable between threads. The `Debug` constraint is to ensure that e.g. `Box<Error>` is `Debug`, and because types that implement `Display` should certainly implement `Debug` in any case. In the near future we expect to add `Any`-like downcasting features to `Error`, but this is waiting on some additional mechanisms (`Reflect`). It will be added before 1.0 via default methods. [breaking-change] r? @alexcrichtonClosesrust-lang#21790
matthiaskrgr added a commit
to matthiaskrgr/rust
that referenced
this pull request
May 15, 2023
…error, r=dtolnay Remove unnecessary Send bound Hi, While working on a [PR on Tokio](tokio-rs/tokio#5666), I took inspiration from the std channel mpsc and stumbled on a `Send` bound for a `Error` impl. Tokio's maintainer `@Darksonn` pointed out to me that `Error` used to required the `Send` bound long time ago (here rust-lang#23541). In the meantime, the `Send` bound `Error` got removed (see rust-lang#21312 and rust-lang#23799). So here a PR to removed this bound for `SendError<T>`, `TrySendError<T>` and `SendTimeoutError<T>`.
bors added a commit
to rust-lang-ci/rust
that referenced
this pull request
May 16, 2023
…ror, r=dtolnay Remove unnecessary Send bound Hi, While working on a [PR on Tokio](tokio-rs/tokio#5666), I took inspiration from the std channel mpsc and stumbled on a `Send` bound for a `Error` impl. Tokio's maintainer `@Darksonn` pointed out to me that `Error` used to required the `Send` bound long time ago (here rust-lang#23541). In the meantime, the `Send` bound `Error` got removed (see rust-lang#21312 and rust-lang#23799). So here a PR to removed this bound for `SendError<T>`, `TrySendError<T>` and `SendTimeoutError<T>`.
RalfJung pushed a commit
to RalfJung/miri
that referenced
this pull request
May 16, 2023
…olnay Remove unnecessary Send bound Hi, While working on a [PR on Tokio](tokio-rs/tokio#5666), I took inspiration from the std channel mpsc and stumbled on a `Send` bound for a `Error` impl. Tokio's maintainer `@Darksonn` pointed out to me that `Error` used to required the `Send` bound long time ago (here rust-lang/rust#23541). In the meantime, the `Send` bound `Error` got removed (see rust-lang/rust#21312 and rust-lang/rust#23799). So here a PR to removed this bound for `SendError<T>`, `TrySendError<T>` and `SendTimeoutError<T>`.
thomcc pushed a commit
to pgcentralfoundation/postgrestd
that referenced
this pull request
Jul 18, 2023
…olnay Remove unnecessary Send bound Hi, While working on a [PR on Tokio](tokio-rs/tokio#5666), I took inspiration from the std channel mpsc and stumbled on a `Send` bound for a `Error` impl. Tokio's maintainer `@Darksonn` pointed out to me that `Error` used to required the `Send` bound long time ago (here rust-lang/rust#23541). In the meantime, the `Send` bound `Error` got removed (see rust-lang/rust#21312 and rust-lang/rust#23799). So here a PR to removed this bound for `SendError<T>`, `TrySendError<T>` and `SendTimeoutError<T>`.
RalfJung pushed a commit
to RalfJung/rust-analyzer
that referenced
this pull request
Apr 20, 2024
…olnay Remove unnecessary Send bound Hi, While working on a [PR on Tokio](tokio-rs/tokio#5666), I took inspiration from the std channel mpsc and stumbled on a `Send` bound for a `Error` impl. Tokio's maintainer `@Darksonn` pointed out to me that `Error` used to required the `Send` bound long time ago (here rust-lang/rust#23541). In the meantime, the `Send` bound `Error` got removed (see rust-lang/rust#21312 and rust-lang/rust#23799). So here a PR to removed this bound for `SendError<T>`, `TrySendError<T>` and `SendTimeoutError<T>`.
RalfJung pushed a commit
to RalfJung/rust-analyzer
that referenced
this pull request
Apr 27, 2024
…olnay Remove unnecessary Send bound Hi, While working on a [PR on Tokio](tokio-rs/tokio#5666), I took inspiration from the std channel mpsc and stumbled on a `Send` bound for a `Error` impl. Tokio's maintainer `@Darksonn` pointed out to me that `Error` used to required the `Send` bound long time ago (here rust-lang/rust#23541). In the meantime, the `Send` bound `Error` got removed (see rust-lang/rust#21312 and rust-lang/rust#23799). So here a PR to removed this bound for `SendError<T>`, `TrySendError<T>` and `SendTimeoutError<T>`.
Kobzol pushed a commit
to Kobzol/portable-simd
that referenced
this pull request
Feb 3, 2026
…olnay Remove unnecessary Send bound Hi, While working on a [PR on Tokio](tokio-rs/tokio#5666), I took inspiration from the std channel mpsc and stumbled on a `Send` bound for a `Error` impl. Tokio's maintainer `@Darksonn` pointed out to me that `Error` used to required the `Send` bound long time ago (here rust-lang/rust#23541). In the meantime, the `Send` bound `Error` got removed (see rust-lang/rust#21312 and rust-lang/rust#23799). So here a PR to removed this bound for `SendError<T>`, `TrySendError<T>` and `SendTimeoutError<T>`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This small commit stabilizes the
Errortrait as-is, except thatSendand
Debugare added as constraints. TheSendconstraint is becausemost uses of
Errorwill be for trait objects, and by default we wouldlike these objects to be transferrable between threads. The
Debugconstraint is to ensure that e.g.
Box<Error>isDebug, and becausetypes that implement
Displayshould certainly implementDebugin any case.In the near future we expect to add
Any-like downcasting features toError, but this is waiting on some additionalmechanisms (
Reflect). It will be added before 1.0 via default methods.[breaking-change]
r? @alexcrichton
Closes#21790