rust/tests/ui/closures/deduce-signature/infer-higher-ranked-signature.rs
lcnr 03878c682a hir typeck: look into nested goals
uses a `ProofTreeVisitor` to look into nested
goals when looking at the pending obligations
during hir typeck. Used by closure signature
inference, coercion, and for async functions.
2024-04-25 19:44:00 +00:00

21 lines
345 B
Rust

//@ revisions: current next
//@ ignore-compare-mode-next-solver (explicit revisions)
//@[next] compile-flags: -Znext-solver
//@ 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: for<'a> Fn(&'a i32) {}
fn main() {
needs_foo(|x| {
x.to_string();
});
}