rust-lang-deprecated / error-chain

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

warning: large size difference between variants #238

Open bbigras opened 6 years ago

bbigras commented 6 years ago
warning: large size difference between variants
  --> src/main.rs:24:5
   |
24 | /     error_chain! {
25 | |         foreign_links {
26 | |             Io(::std::io::Error) #[cfg(unix)];
27 | |             Log(::log::SetLoggerError);
...  |
30 | |         }
31 | |     }
   | |_____^
   |
   = note: #[warn(large_enum_variant)] on by default
   = help: for further information visit https://rust-lang-nursery.github.io/rust-clippy/v0.0.166/index.html#large_enum_variant
help: consider boxing the large fields to reduce the total size of the enum
   |
113| err : Box<$ foreign_link_error_path> ) {
   |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   = note: this error originates in a macro outside of the current crate
error_chain! {
    foreign_links {
        Io(::std::io::Error);
        Log(::log::SetLoggerError);
        Mysql(::mysql::Error);
        Var(::std::env::VarError);
    }
}

rustc 1.22.0-nightly (4750c1ec0 2017-10-19) error-chain 0.11.0

pickfire commented 5 years ago

Any suggestions that could be used to solve this? Do we really need to use Box?