Skip to content

error-stack: Is there any way to clone error_stack::Result? #2764

Discussion options

You must be logged in to vote

No, a Report cannot be cloned as the errors inside of Report don't necessarily implement Clone. This would require a bound T: Clone on any operation on Report (i.e. all contexts and attachments would need to be Cloneable) but it's very common that errors don't implement Clone. As a very prominent example, std::io::Error does not implement Clone. Adding a Clone bound would imply that many errors would not work with error-stack anymore.

Replies: 1 comment 1 reply

Comment options

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

Answer selected by jrmoulton
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state/rejected This issue will not be worked on (previously "Won't Fix") area/libs > error-stack Affects the `error-stack` crate (library) area/libs Relates to first-party libraries/crates/packages (area)
2 participants