Skip to content

let_underscore_untyped doesn't get triggered when _ is used without let #15658

@zacknewman

Description

@zacknewman

Summary

The justification for the let_underscore_untyped lint seems to apply when _ is used without a let binding. I realize this means the use of _ is impossible with this lint, but that's not uncommon for restrictionlints.

#![expect(dead_code, reason = "illustrative example")] #![deny(clippy::let_underscore_untyped, reason = "illustrative example")] fn bar() { // Doesn't this suffer from the same drawbacks as `let _ = foo();`? _ = foo(); // Uncommenting below will cause a compile error due to the `let_underscore_untyped` lint. // let _ = foo(); } fn foo() -> Result<(), u32> { Ok(()) }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions