Fix ICE in let_unit_value when calling a static or const callable type

This commit is contained in:
Jason Newcomb 2022-05-16 10:00:32 -04:00
parent a1632fffc1
commit c649d4e8a7
3 changed files with 29 additions and 6 deletions

View file

@ -0,0 +1,8 @@
#![warn(clippy::let_unit_value)]
fn f() {}
static FN: fn() = f;
fn main() {
let _: () = FN();
}

View file

@ -0,0 +1,10 @@
error: this let-binding has unit value
--> $DIR/ice-8821.rs:7:5
|
LL | let _: () = FN();
| ^^^^^^^^^^^^^^^^^ help: omit the `let` binding: `FN();`
|
= note: `-D clippy::let-unit-value` implied by `-D warnings`
error: aborting due to previous error