Closed

Description
pub struct Foo<A,B> {
f: fn(A, B) -> bool
}
impl<A,B> Foo<A,B> {
pub fn new(f: fn(A, B) -> bool) -> Foo<A,B> {
Foo { f: f }
}
}
fn main() {
let foo = Foo::<bool,bool>::new(|a,b| -> bool { a && b });
}
main.rs:15:57: 15:58 error: the type of this value must be known in this context
main.rs:15 let foo = Foo::<bool,bool>::new(|a,b| -> bool { a && b });
It does work when changing the code to expect a closure rather than a function, or when passing the expected function, but the error message here is either wrong/misleading, or there's a real bug.
Metadata
Metadata
Assignees
Labels
No labels