rust/tests/ui/closures/infer-signature-from-impl.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

21 lines
342 B
Rust
Raw Normal View History

//@ revisions: current next
2023-12-14 06:11:28 -06:00
//@[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();
});
}