]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/used_underscore_binding.rs
Test that we lint the awaited expression
[rust.git] / tests / ui / used_underscore_binding.rs
index c94bee1d162303d68714a7b40d1ab15c15dbfa24..8e0243c49aaa038405796a66695a6f264f38b569 100644 (file)
@@ -87,11 +87,20 @@ fn non_variables() {
     let f = _fn_test;
     f();
 }
-// Tests that we do not lint if the binding comes from await desugaring.
-// See issue 5360.
+
+// Tests that we do not lint if the binding comes from await desugaring,
+// but we do lint the awaited expression. See issue 5360.
 async fn await_desugaring() {
     async fn foo() {}
+    fn uses_i(_i: i32) {}
+
     foo().await;
+    ({
+        let _i = 5;
+        uses_i(_i);
+        foo()
+    })
+    .await
 }
 
 fn main() {