We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0928a1f commit 1db70e1Copy full SHA for 1db70e1
tests/ui/higher-ranked/trait-bounds/future.rs
@@ -0,0 +1,30 @@
1
+// edition:2021
2
+// revisions: classic next
3
+//[next] compile-flags: -Ztrait-solver=next
4
+//[next] check-pass
5
+
6
+#![feature(unboxed_closures)]
7
8
+use std::future::Future;
9
10
+trait Trait {
11
+ fn func(&self, _: &str);
12
+}
13
14
+impl<T> Trait for T
15
+where
16
+ for<'a> T: Fn<(&'a str,)> + Send + Sync,
17
+ for<'a> <T as FnOnce<(&'a str,)>>::Output: Future<Output = usize> + Send,
18
+{
19
+ fn func(&self, _: &str) {
20
+ println!("hello!");
21
+ }
22
23
24
+async fn strlen(x: &str) -> usize {
25
+ x.len()
26
27
28
+fn main() {
29
+ strlen.func("hi");
30
0 commit comments