forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#8835 - Jarcho:let_unit_ice, r=llogiq
Fix ICE in `let_unit_value` when calling a static or const callable type fixes rust-lang#8821 changelog: Fix ICE in `let_unit_value` when calling a static or const callable type
- Loading branch information
Showing
3 changed files
with
29 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#![warn(clippy::let_unit_value)] | ||
|
||
fn f() {} | ||
static FN: fn() = f; | ||
|
||
fn main() { | ||
let _: () = FN(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|