Skip to content

Commit fa2f31b

Browse files
More tests
1 parent 9f59ab5 commit fa2f31b

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// check-pass
2+
3+
trait Foo<'a> {
4+
type Input;
5+
}
6+
7+
impl<F: Fn(u32)> Foo<'_> for F {
8+
type Input = u32;
9+
}
10+
11+
trait SuperFn: for<'a> Foo<'a> + for<'a> Fn(<Self as Foo<'a>>::Input) {}
12+
impl<T> SuperFn for T where T: for<'a> Fn(<Self as Foo<'a>>::Input) + for<'a> Foo<'a> {}
13+
14+
fn needs_super(_: impl SuperFn) {}
15+
16+
fn main() {
17+
needs_super(|_: u32| {});
18+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// check-pass
2+
3+
4+
trait Foo<'a> {
5+
type Input;
6+
}
7+
8+
impl<F: Fn(u32)> Foo<'_> for F {
9+
type Input = u32;
10+
}
11+
12+
fn needs_super<F: for<'a> Fn(<F as Foo<'a>>::Input) + for<'a> Foo<'a>>(_: F) {}
13+
14+
fn main() {
15+
needs_super(|_: u32| {});
16+
}

0 commit comments

Comments
 (0)