Skip to content

let_underscore_drop and ignoring error  #9314

Closed
@uselessgoddess

Description

@uselessgoddess

I ignore some errors with try block. I annotate type via let _: Result<...> = try { ... }. But clippy:

warning: non-binding `let` on a type that implements `Drop`
  --> some/path:
   |
   | /         let _: Result<_> = try {
   | |            . . .
   | |         };
   | |__________^
   |
   = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_drop

How can I fix this

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: Clippy is not doing the correct thingI-false-negativeIssue: The lint should have been triggered on code, but wasn't

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions