Add From<E: Error + Send> for Box<dyn Error + Send> impl#73878
Add From<E: Error + Send> for Box<dyn Error + Send> impl#73878roblabla wants to merge 2 commits intorust-lang:masterfrom
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 + !Sendis extremely rare/shouldn't happen. Thus,Send + SyncandSyncare much the same.