From b8deb93b22b8f67b53f400849aa233610e32381c Mon Sep 17 00:00:00 2001 From: Esteban Kuber Date: Thu, 23 Sep 2021 11:29:52 +0000 Subject: [PATCH] Add test --- src/test/ui/typeck/call-block.rs | 3 +++ src/test/ui/typeck/call-block.stderr | 11 +++++++++++ 2 files changed, 14 insertions(+) create mode 100644 src/test/ui/typeck/call-block.rs create mode 100644 src/test/ui/typeck/call-block.stderr diff --git a/src/test/ui/typeck/call-block.rs b/src/test/ui/typeck/call-block.rs new file mode 100644 index 000000000000..1d5244411a22 --- /dev/null +++ b/src/test/ui/typeck/call-block.rs @@ -0,0 +1,3 @@ +fn main() { + let _ = {42}(); //~ ERROR expected function, found `_` +} diff --git a/src/test/ui/typeck/call-block.stderr b/src/test/ui/typeck/call-block.stderr new file mode 100644 index 000000000000..20f61dd23ac4 --- /dev/null +++ b/src/test/ui/typeck/call-block.stderr @@ -0,0 +1,11 @@ +error[E0618]: expected function, found `_` + --> $DIR/call-block.rs:2:13 + | +LL | let _ = {42}(); + | ^^^^-- + | | + | call expression requires function + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0618`.