-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove Send bound from Error trait. #21312
Merged
Merged
Conversation
This file contains 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
r? @pcwalton (rust_highfive has picked a reviewer for you, use r? to override) |
Apparently this is also part of a larger RFC, but I couldn't find it... |
r? @aturon |
@bors: rollup |
barosl
added a commit
to barosl/rust
that referenced
this pull request
Jan 20, 2015
…nd, r=aturon As discussed with @aturon, this PR removes the `Send` bound from `std::error::Error`, allowing us to implement `Error` for error types containing non-`Send` types. Current examples include `PoisonError` and `TryLockError` from `std::sync` which contain a Guard that we don't want sent between tasks. [breaking-change]
barosl
added a commit
to barosl/rust
that referenced
this pull request
Jan 20, 2015
…lexcrichton Two errors in `std::sync` are currently missing implementations of the standard error trait because they contain types which aren't `Send`. This PR therefore requires rust-lang#21312.
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 tcdi/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>`.
Sign up for free
to 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.
As discussed with @aturon, this PR removes the
Send
bound fromstd::error::Error
, allowing us to implementError
for error types containing non-Send
types. Current examples includePoisonError
andTryLockError
fromstd::sync
which contain a Guard that we don't want sent between tasks.[breaking-change]