summaryrefslogtreecommitdiffstats
path: root/src/test/ui/suggestions/issue-97704.fixed
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/suggestions/issue-97704.fixed')
-rw-r--r--src/test/ui/suggestions/issue-97704.fixed19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/test/ui/suggestions/issue-97704.fixed b/src/test/ui/suggestions/issue-97704.fixed
new file mode 100644
index 000000000..c42bdfff5
--- /dev/null
+++ b/src/test/ui/suggestions/issue-97704.fixed
@@ -0,0 +1,19 @@
+// edition:2021
+// run-rustfix
+
+#![allow(unused)]
+
+use std::future::Future;
+
+async fn foo() -> Result<(), i32> {
+ func(async { Ok::<_, i32>(()) }).await?;
+ //~^ ERROR the `?` operator can only be applied to values that implement `Try`
+
+ Ok(())
+}
+
+async fn func<T>(fut: impl Future<Output = T>) -> T {
+ fut.await
+}
+
+fn main() {}