shepmaster / snafu

Easily assign underlying errors into domain-specific errors while adding context
https://docs.rs/snafu/
Apache License 2.0
1.4k stars 60 forks source link

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

Closed shepmaster closed 1 year ago

shepmaster commented 1 year ago

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 commented 1 year ago

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.