Skip to content

Commit

Permalink
Auto merge of rust-lang#10442 - dtolnay-contrib:letunderscore, r=llogiq
Browse files Browse the repository at this point in the history
Downgrade let_underscore_untyped to restriction

From reading rust-lang#6842 I am not convinced of the cost/benefit of this lint even as a pedantic lint.

It sounds like the primary motivation was to catch cases of `fn() -> Result` being changed to `async fn() -> Result`. If the original Result was ignored by a `let _`, then the compiler wouldn't guide you to add `.await`. **However, this situation is caught in a more specific way by [let_underscore_future](https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_future) which was introduced _after_ the original suggestion (rust-lang#9760).**

In rust-lang#10410 it was mentioned twice that a <kbd>restriction</kbd> lint might be more appropriate for let_underscore_untyped.

changelog: Moved [`let_underscore_untyped`] to restriction
  • Loading branch information
bors committed Mar 4, 2023
2 parents d423703 + 03b9940 commit 308d680
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion clippy_lints/src/let_underscore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ declare_clippy_lint! {
/// ```
#[clippy::version = "1.69.0"]
pub LET_UNDERSCORE_UNTYPED,
pedantic,
restriction,
"non-binding `let` without a type annotation"
}

Expand Down

0 comments on commit 308d680

Please sign in to comment.