out_of_bounds/out_of_bounds.rs
use quickcheck::{quickcheck, TestResult};
fn main() {
fn prop(length: usize, index: usize) -> TestResult {
let v: Vec<_> = (0..length).collect();
if index < length {
TestResult::discard()
} else {
TestResult::must_fail(move || v[index])
}
}
quickcheck(prop as fn(usize, usize) -> TestResult);
}