rust/src/test/compile-fail/do-while-pred-constraints.rs

25 lines
359 B
Rust
Raw Normal View History

// error-pattern: Unsatisfied precondition constraint (for example, even(y
2011-07-27 07:48:34 -05:00
fn print_even(y: int) : even(y) {
log y;
}
2011-07-27 07:48:34 -05:00
pred even(y: int) -> bool {
true
}
fn main() {
2011-07-27 07:48:34 -05:00
let y: int = 42;
check even(y);
do {
print_even(y);
do {
do {
do {
y += 1;
} while (true);
} while (true);
} while (true);
} while (true);
}