-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Needs decision: should Error
inherit from Send
?
#23774
Comments
cc @alexcrichton :) |
@aturon note that this is blocking iron from building, so a swift decision would be quite appreciated |
My feeling, as summarized to @aturon over IRC: better to be more general. If it turns out that people forget the Send a lot (and they probably will), we can always introduce an alias or something for |
The Send bound is an unnecessary restriction, and though provided as a convenience, can't be removed by downstream code. The removal of this bound is a [breaking-change] since it removes an implicit Send bound on all `E: Error` and all `Error` trait objects. To migrate, consider if your code actually requires the Send bound and, if so, add it explicitly. Fixes rust-lang#23774
Does anyone think this needs an RfC? Though I believe the original |
@Manishearth Yeah, I would consider this a relatively minor implementation detail. It's gone back and forth a few times since the original reform. I'm personally OK changing it a final time without an RFC. |
The Send bound is an unnecessary restriction, and though provided as a convenience, can't be removed by downstream code. The removal of this bound is a [breaking-change] since it removes an implicit Send bound on all `E: Error` and all `Error` trait objects. To migrate, consider if your code actually requires the Send bound and, if so, add it explicitly. Fixes #23774 r? @aturon
The
Error
trait was recently changed, once again, to inherit fromSend
. This was done mostly becauseBox<Error>
, especially onceError
incorporated downcasting,Box<Error>
between threads and not be able to, and,Send
anyway.However, there are some cases in important libraries like Iron that involve non-
Send
errors, at least at the moment.We need to make a final decision here. Should we instead require people to know about and use
Box<Error + Send>
when they need it?The text was updated successfully, but these errors were encountered: