Impl core::error::Error instead of std::error::Error - #333
Conversation
I think I'd rather bump the MSRV than use a cargo flag for it. If the only difference between 0.20.x and 0.21.0 is an MSRV bump for this purpose, upgrading will be very easy for those who can upgrade, and those who can't upgrade won't be missing out on anything.
I wouldn't consider a version that included if rustversion::cfg!(since(1.81)) {
// generate core::error::Error impl
} |
|
|
||
| if self.std { | ||
| tokens.append_all(quote!( | ||
| impl std::error::Error for #builder_error_ident {} |
There was a problem hiding this comment.
In ≥1.81, is there some blanket impl on std::error::Error that means all core::error::Error impls are satisfactory? If not, do we need to emit both impls to avoid breaking compatibility?
Hey there,
thanks for the great library! I noticed that the Error trait is not implemented for BuilderErrors when the
stdfeature is inactive. Rust 1.81 stabilized core::error::Error, it would be nice if this crate could make use of it and lift the former restriction. Since, as implemented, this would be a breaking change, I'm wondering what the preferred way forward is. I can think ofcore_errorthat opts into using core::error::Error instead of the std version#[rustversion::since(1.81)]