summaryrefslogtreecommitdiffstats
path: root/tests/ui/async-await/dont-suggest-missing-await.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/async-await/dont-suggest-missing-await.rs')
-rw-r--r--tests/ui/async-await/dont-suggest-missing-await.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/ui/async-await/dont-suggest-missing-await.rs b/tests/ui/async-await/dont-suggest-missing-await.rs
new file mode 100644
index 000000000..a8e5b38ec
--- /dev/null
+++ b/tests/ui/async-await/dont-suggest-missing-await.rs
@@ -0,0 +1,19 @@
+// edition:2018
+
+// This test ensures we don't make the suggestion in bodies that aren't `async`.
+
+fn take_u32(x: u32) {}
+
+async fn make_u32() -> u32 {
+ 22
+}
+
+async fn dont_suggest_await_in_closure() {
+ || {
+ let x = make_u32();
+ take_u32(x)
+ //~^ ERROR mismatched types [E0308]
+ };
+}
+
+fn main() {}