error-chain
error-chain copied to clipboard
Use Void in __Nonexhaustive
This prevents construction of this variant.
Use a hidden public wrapper over void::Void for 2 reasons:
- Users shouldn't need to specify a
voiddependency in Cargo.toml to useerror-chain. - We can reuse whatever trait impls defined for
void::Void.
Alternatively, error-chain can define its own enum Void {} to bring down amount of dependencies (as a rather fundamental crate, more dependencies can lead to issues, in my opinion).
Technically, this is a breaking change because __Nonexhaustive in 0.11.0 can still be used. If compatibility is a concern, void can be made an optional dependency and disabled by default - then 0.11.1 will only add a Cargo feature without breaking changes.
It should be noted that if there is a crate A that depends on error-chain 0.11.1 with the "void" feature enabled and a crate B which depends on the same version with "void" disabled, they are still incompatible. So it might be better to bump to 0.12 after all, since it's a breaking change anyway.
Can you help me understand the use case?