rust/tests/ui/closures/infer-signature-from-impl.rs
2023-12-14 15:22:37 +01:00

21 lines
338 B
Rust

// revisions: current next
//[next] compile-flags: -Znext-solver
//[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();
});
}