about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/crashes/ice-8821.rs8
-rw-r--r--tests/ui/crashes/ice-8821.stderr10
2 files changed, 18 insertions, 0 deletions
diff --git a/tests/ui/crashes/ice-8821.rs b/tests/ui/crashes/ice-8821.rs
new file mode 100644
index 00000000000..fb87b79aeed
--- /dev/null
+++ b/tests/ui/crashes/ice-8821.rs
@@ -0,0 +1,8 @@
+#![warn(clippy::let_unit_value)]
+
+fn f() {}
+static FN: fn() = f;
+
+fn main() {
+    let _: () = FN();
+}
diff --git a/tests/ui/crashes/ice-8821.stderr b/tests/ui/crashes/ice-8821.stderr
new file mode 100644
index 00000000000..486096e0a06
--- /dev/null
+++ b/tests/ui/crashes/ice-8821.stderr
@@ -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
+