-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Add From<E: Error + Send> for Box<dyn Error + Send> impl #73878
Conversation
28698df
to
3597d0d
Compare
(rust_highfive has picked a reviewer for you, use r? to override) |
This seems reasonable, but someone from @rust-lang/libs needs to review it. Also, you need to update tests. |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
Yeah I'm on it (currently waiting for rust to compile, which is taking ages on my slow machine). To make impl From<String> for Box<dyn Error + Send> {}
impl<'a> From<&str> for Box<dyn Error + Send + 'a> {}
impl<'a, 'b> From<Cow<'a, str>> for Box<dyn Error + Send + 'b> {} On that note, I'm having a hard time understanding the lifetimes here... Take the following two impls: impl From<&str> for Box<dyn Error>;
impl<'a> From<&str> for Box<dyn Error + Send + Sync + 'a>; What's |
☔ The latest upstream changes (presumably #74060) made this pull request unmergeable. Please resolve the merge conflicts. |
Well,there's MutexGuard , RwLockReadGuard , and RwLockWriteGuard ,which I guess are rare. I also don't know how often they'd be put inside an error type. |
going to close this pr due to inactivity. If you wish, and you have a fix that resolves the error above you can submit a new pull request, and we'll take it from there. Thanks for taking the time to contribute :) |
Adds the following implementation:
Partially fixes #62824
Said issue also mentions adding an
impl<'a, E: Error + Sync + 'a> From<E> for Box<dyn Error + Sync + 'a> {}
, but I doubt its usefulness. AFAIK, a type that isSync + !Send
is extremely rare/shouldn't happen. Thus,Send + Sync
andSync
are much the same.