Skip to content

ref_from_bytes's inclusion of the input reference in the Err() result doesn't play nice with popular error-handling library anyhow #2498

Answered by jswrenn
kit299 asked this question in Q&A
Discussion options

You must be logged in to vote

It's anyhow that imposes the 'static requirement, since — under the hood — anyhow Boxes up (and type erases) the error value. The requirement specifically comes from this conversion, which is implicitly invoked by ?.

The correct solution is, yes, to map zerocopy's error to something else that meets these requirements. We're lightly looking into providing an API that would make this easier, but it's not on our near-term roadmap right now.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@kit299
Comment options

Answer selected by kit299
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants