Added compile-fail tests
This commit is contained in:
parent
87b5f05a9d
commit
0707780eac
25
src/test/compile-fail/lint-type-limits.rs
Normal file
25
src/test/compile-fail/lint-type-limits.rs
Normal file
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user