rust-lang-deprecated / error-chain

Error boilerplate for Rust
Apache License 2.0
729 stars 111 forks source link

Use Void in __Nonexhaustive #237

Open hcpl opened 6 years ago

hcpl commented 6 years ago

This prevents construction of this variant.

Use a hidden public wrapper over void::Void for 2 reasons:

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.

hcpl commented 6 years ago

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.

AndyGauge commented 5 years ago

Can you help me understand the use case?