Arnavion / derive-error-chain

A Macros 1.1 implementation of https://crates.io/crates/error-chain
19 stars 1 forks source link

Don't require `ErrorKind` to be `pub` #17

Closed Arnavion closed 6 years ago

Arnavion commented 7 years ago
  • The ErrorKind must have pub visibility. error_chain! does this implicitly.

This rule exists because Error, Result and ResultExt are always emitted with pub, so the ErrorKind needs to be pub to avoid "private type is exposed publicly" errors.

Instead, those three should only be pub if the ErrorKind is pub.