]> git.lizzy.rs Git - rust.git/commitdiff
add ui test for issue-62097
authorcsmoe <csmoe@msn.com>
Wed, 23 Oct 2019 17:25:05 +0000 (01:25 +0800)
committercsmoe <csmoe@msn.com>
Mon, 11 Nov 2019 13:37:13 +0000 (21:37 +0800)
src/test/ui/async-await/issues/issue-62097.rs [new file with mode: 0644]

diff --git a/src/test/ui/async-await/issues/issue-62097.rs b/src/test/ui/async-await/issues/issue-62097.rs
new file mode 100644 (file)
index 0000000..ea482d3
--- /dev/null
@@ -0,0 +1,19 @@
+// edition:2018
+async fn foo<F>(fun: F)
+where
+    F: FnOnce() + 'static
+{
+    fun()
+}
+
+struct Struct;
+
+impl Struct {
+    pub async fn run_dummy_fn(&self) { //~ ERROR cannot infer
+        foo(|| self.bar()).await;
+    }
+
+    pub fn bar(&self) {}
+}
+
+fn main() {}