Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug derivative causes clippy warning let_underscore_must_use #102

Open
vicky5124 opened this issue Dec 25, 2021 · 0 comments
Open

Debug derivative causes clippy warning let_underscore_must_use #102

vicky5124 opened this issue Dec 25, 2021 · 0 comments
Labels
bug The crate does not work as expected

Comments

@vicky5124
Copy link

Describe the bug

Debug derivative causes clippy warning let_underscore_must_use

To Reproduce

#![error(clippy::let_underscore_must_use)]

#[derive(derivative::Derivative)]
#[derivative(Debug)]
pub struct Test {
    pub test: String,
}

Expected behavior

The clippy warning shouldn't show up, as there's no let bindings being used by the user when defining a structure.

Errors

cargo clippy

error: non-binding let on an expression with `#[must_use]` type
  --> src/lib.rs:16:12
   |
16 | pub struct Test {
   |            ^^^^
   |
note: the lint level is defined here
  --> src/lib.rs:5:5
   |
5  |     clippy::let_underscore_must_use
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   = help: consider explicitly using expression value
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_must_use

Version

rustup 1.24.3 (ce5817a94 2021-05-31)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.59.0-nightly (0b42deacc 2021-12-09)`
cargo 1.58.0-nightly (40dc28175 2021-12-06)
rustc 1.59.0-nightly (0b42deacc 2021-12-09)
  • Version of derivative: 2.2.0
@vicky5124 vicky5124 added the bug The crate does not work as expected label Dec 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The crate does not work as expected
Projects
None yet
Development

No branches or pull requests

1 participant