rust-lang-deprecated / error-chain

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

Importing the macro Rust 2018 way #250

Closed valpackett closed 5 years ago

valpackett commented 6 years ago

Looks like it's not possible to use the error_chain macro as it's defined in a private module...

Procrat commented 6 years ago

It looks like it works when you do this:

    use error_chain::error_chain;
    use error_chain::error_chain_processing;
    use error_chain::impl_error_chain_processed;
    use error_chain::impl_error_chain_kind;
    use error_chain::impl_extract_backtrace;

    error_chain! {
         ...
    }

(Definitely not saying you should do that, but at least you can make it compile now.)

joepie91 commented 5 years ago

The ergonomics problem here is described more in this post, along with a solution that apparently needs to be implemented by error-chain itself.