dtolnay / thiserror

derive(Error) for struct and enum error types

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

#[error(transparent)] triggers `clippy::used_underscore_binding` lint

U007D opened this issue · comments

#[derive(Debug, Error, PartialEq)]
pub enum Error {
    // ...
    #[error(transparent)]
    VersionError(#[from] SomeOtherVersionError),
}

yields

error: used binding `_0` which is prefixed with an underscore. A leading underscore signals that a binding will not be used.
 --> src/error.rs:9:13
  |
9 |     #[error(transparent)]
  |             ^^^^^^^^^^^
  |
note: the lint level is defined here
 --> src/main.rs:7:5
  |
7 |     clippy::pedantic,
  |     ^^^^^^^^^^^^^^^^
  = note: `#[deny(clippy::used_underscore_binding)]` implied by `#[deny(clippy::pedantic)]`
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#used_underscore_binding

Fixed in 1.0.19.