Closed
Description
Using rustc 1.0.0-nightly (3d0d9bb6f 2015-01-12 22:56:20 +0000):
fn reverse<T: Clone>(xs: &[T]) -> Vec<T> {
let mut rev = vec!();
for x in xs.iter() {
rev.insert(0, x.clone())
}
rev
}
#[test]
fn reverse_identity() {
fn prop(xs: Vec<i32>) -> bool {
xs == reverse(reverse(xs.as_slice()).as_slice())
}
quickcheck(prop);
}
produces
error: the trait `quickcheck::tester::Testable` is not implemented for the type `fn(collections::vec::Vec<i32>) -> bool {tests::reverse_identity::prop}`
quickcheck(false)
compiles; this appears to be specific to the fn impls, including the zero-arg fn.