Skip to content

impl Error for Box lacks source() impl #61899

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

Closed
s3bk opened this issue Jun 16, 2019 · 0 comments · Fixed by #61900
Closed

impl Error for Box lacks source() impl #61899

s3bk opened this issue Jun 16, 2019 · 0 comments · Fixed by #61900
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@s3bk
Copy link
Contributor

s3bk commented Jun 16, 2019

the Error impl of Box<T: Error> does not include the source function, however it contains cause, causing different results when switching from cause to source.
A small code that demonstrates this is here.

Solution: implement source() for Box<T: Error> by forwarding to T::source()

@jonas-schievink jonas-schievink added C-enhancement Category: An issue proposing an enhancement or a PR with one. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Jun 16, 2019
s3bk added a commit to s3bk/rust that referenced this issue Jun 17, 2019
Centril added a commit to Centril/rust that referenced this issue Jun 20, 2019
implement Error::source for Box<T: Error>

fixes rust-lang#61899
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants