diff options
Diffstat (limited to '')
-rw-r--r-- | tests/ui/closures/infer-signature-from-impl.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/ui/closures/infer-signature-from-impl.rs b/tests/ui/closures/infer-signature-from-impl.rs new file mode 100644 index 000000000..6e8c94177 --- /dev/null +++ b/tests/ui/closures/infer-signature-from-impl.rs @@ -0,0 +1,20 @@ +// revisions: current next +//[next] compile-flags: -Ztrait-solver=next +//[next] known-bug: trait-system-refactor-initiative#71 +//[current] check-pass + +trait Foo {} +fn needs_foo<T>(_: T) +where + Wrap<T>: Foo, +{ +} + +struct Wrap<T>(T); +impl<T> Foo for Wrap<T> where T: Fn(i32) {} + +fn main() { + needs_foo(|x| { + x.to_string(); + }); +} |