Fix ICE in let_unit_value when calling a static or const callable type
This commit is contained in:
parent
a1632fffc1
commit
c649d4e8a7
3 changed files with 29 additions and 6 deletions
8
tests/ui/crashes/ice-8821.rs
Normal file
8
tests/ui/crashes/ice-8821.rs
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
#![warn(clippy::let_unit_value)]
|
||||
|
||||
fn f() {}
|
||||
static FN: fn() = f;
|
||||
|
||||
fn main() {
|
||||
let _: () = FN();
|
||||
}
|
||||
10
tests/ui/crashes/ice-8821.stderr
Normal file
10
tests/ui/crashes/ice-8821.stderr
Normal 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
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue