Skip to content

Commit 97c06f5

Browse files
authored
Unrolled build for rust-lang#119376
Rollup merge of rust-lang#119376 - msrd0:regression-test-106630, r=petrochenkov Add regression test for rust-lang#106630 This PR adds a regression test for rust-lang#106630. I was unsure where exactly to place the test or how to test it locally so please let me know if I should change something.
2 parents f4d794e + a88c9a6 commit 97c06f5

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// edition:2018
2+
// run-pass
3+
4+
use std::future::Future;
5+
6+
trait AsyncCallback<'a> {
7+
type Out;
8+
}
9+
10+
impl<'a, Fut, T, F> AsyncCallback<'a> for F
11+
where
12+
F: FnOnce(&'a mut ()) -> Fut,
13+
Fut: Future<Output = T> + Send + 'a,
14+
{
15+
type Out = T;
16+
}
17+
18+
trait CallbackMarker {}
19+
20+
impl<F, T> CallbackMarker for F
21+
where
22+
T: 'static,
23+
for<'a> F: AsyncCallback<'a, Out = T> + Send,
24+
{
25+
}
26+
27+
fn do_sth<F: CallbackMarker>(_: F) {}
28+
29+
async fn callback(_: &mut ()) -> impl Send {}
30+
31+
fn main() {
32+
do_sth(callback);
33+
}

0 commit comments

Comments
 (0)