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

CompatChain returns &'a dyn Error + 'a which cannot be downcast #370

Closed
shepmaster opened this issue Dec 15, 2022 · 1 comment · Fixed by #397
Closed

CompatChain returns &'a dyn Error + 'a which cannot be downcast #370

shepmaster opened this issue Dec 15, 2022 · 1 comment · Fixed by #397
Labels
breaking change Likely requires a SemVer version bump bug Something isn't working

Comments

@shepmaster
Copy link
Owner

shepmaster commented Dec 15, 2022

It should be &'a dyn Error + 'static. Doing this means that the public constructor needs to be modified, making it technically a breaking change.

@shepmaster shepmaster added bug Something isn't working breaking change Likely requires a SemVer version bump labels Dec 15, 2022
@shepmaster
Copy link
Owner Author

Hmm. It turns out we rely on the current behavior in Report. Instead of switching the hard-coded lifetimes from + 'a to + 'static, we can introduce a second lifetime.

shepmaster added a commit that referenced this issue Aug 20, 2023
Previously it unconditionally returned &'a (dyn Error + 'a) which
was never downcastable. The additional lifetime can be `'static`,
resulting in `&'a (dyn Error + 'static)`, which may be downcast.

Closes #370
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change Likely requires a SemVer version bump bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant