about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-04-29 22:22:41 +0200
committerGitHub <noreply@github.com>2019-04-29 22:22:41 +0200
commit3091961621fe4fc06892887b75d867b1bb0ec1ad (patch)
tree32f6c3c0ac173fa7a5da00509f9339009429a7d0
parentead8d81301c1854e7ec251a57239813f6dfa8001 (diff)
parent52356cad4e749dd394d5f7571f4589b9d1430db5 (diff)
downloadrust-3091961621fe4fc06892887b75d867b1bb0ec1ad.tar.gz
rust-3091961621fe4fc06892887b75d867b1bb0ec1ad.zip
Rollup merge of #60353 - JohnTitor:add-test, r=Centril
Add test not to forget resolved ICE

closes #55499

I added the example as a test.

r? @pnkfelix
-rw-r--r--src/test/ui/async-with-closure.rs26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/test/ui/async-with-closure.rs b/src/test/ui/async-with-closure.rs
new file mode 100644
index 00000000000..856a778078a
--- /dev/null
+++ b/src/test/ui/async-with-closure.rs
@@ -0,0 +1,26 @@
+// compile-pass
+// edition:2018
+
+#![feature(async_await, await_macro)]
+
+trait MyClosure {
+    type Args;
+}
+
+impl<R> MyClosure for dyn FnMut() -> R
+where R: 'static {
+    type Args = ();
+}
+
+struct MyStream<C: ?Sized + MyClosure> {
+    x: C::Args,
+}
+
+async fn get_future<C: ?Sized + MyClosure>(_stream: MyStream<C>) {}
+
+async fn f() {
+    let messages: MyStream<FnMut()> = unimplemented!();
+    await!(get_future(messages));
+}
+
+fn main() {}