Added compile-fail tests

This commit is contained in:
Viktor Dahl 2012-10-24 19:14:50 +02:00
parent 87b5f05a9d
commit 0707780eac

@ -0,0 +1,25 @@
// compile-flags: -D type-limits
fn main() { }
fn foo() {
let mut i = 100u;
while i >= 0 { //~ ERROR comparison is useless due to type limits
i -= 1;
}
}
fn bar() -> i8 {
return 123;
}
fn baz() -> bool {
128 > bar() //~ ERROR comparison is useless due to type limits
}
fn qux() {
let mut i = 1i8;
while 200 != i { //~ ERROR comparison is useless due to type limits
i += 1;
}
}