Skip to content
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

There should be a Box<Error+Send+Sync> -> Box<Error> From conversion #28773

Closed
talchas opened this issue Sep 30, 2015 · 3 comments
Closed

There should be a Box<Error+Send+Sync> -> Box<Error> From conversion #28773

talchas opened this issue Sep 30, 2015 · 3 comments

Comments

@talchas
Copy link

talchas commented Sep 30, 2015

This conversion is done implicitly, but implicit conversions aren't done in generic lookup. This means that

fn foo() -> Result<(), Box<Error + Send + Sync>> { try!(Err("foo")) }
fn bar() -> Result<(), Box<Error>> { try!(foo()); }

will fail, which is obnoxious and means adding these bounds in a library is not just a theoretical breaking change, but one that will happen. The impl would be trivial.

@jonas-schievink
Copy link
Contributor

I could also imagine implicit coercions from Box<A + B> to Box<A> and Box<B> to work quite well in general.

Tangentially related: #28326 and rust-lang/rfcs#1277

@steveklabnik
Copy link
Member

/cc @rust-lang/libs

@steveklabnik
Copy link
Member

Triage: trivial impls like this can be done via PR; please send one in if this is still needed, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants