Closed
Description
If you throw the following code into playpen, in the fourth case (by my reading of the error message) Rust determines an incompatible number of lifetime parameters for<'r> core::ops::Fn<(&'r u64, &'r u64)>
vs. for<'r,'r> core::ops::Fn<(&'r u64, &'r u64)>
).
fn test<F: Fn(&u64, &u64)>(f: F) {}
fn main() {
test(|x, y | {}); // works
test(|x:&u64, y:&u64| {}); // works
test(|x:&u64, y | {}); // works
test(|x, y:&u64| {}); // no works
}
I won't try to explain how mysterious this was, manifesting as a "sorry, you don't implement that trait" error (because the closure was not matching the type) without explaining what was awry.