rust/src/test/compile-fail/do-while-pred-constraints.rs
2011-07-27 15:54:33 +02:00

26 lines
375 B
Rust

// xfail-stage0
// error-pattern: Unsatisfied precondition constraint (for example, even(y
fn print_even(y: int) : even(y) {
log y;
}
pred even(y: int) -> bool {
true
}
fn main() {
let y: int = 42;
check even(y);
do {
print_even(y);
do {
do {
do {
y += 1;
} while (true);
} while (true);
} while (true);
} while (true);
}