Skip to content

Commit 0707780

Browse files
committedOct 24, 2012
Added compile-fail tests
1 parent 87b5f05 commit 0707780

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
 
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// compile-flags: -D type-limits
2+
fn main() { }
3+
4+
fn foo() {
5+
let mut i = 100u;
6+
while i >= 0 { //~ ERROR comparison is useless due to type limits
7+
i -= 1;
8+
}
9+
}
10+
11+
fn bar() -> i8 {
12+
return 123;
13+
}
14+
15+
fn baz() -> bool {
16+
128 > bar() //~ ERROR comparison is useless due to type limits
17+
}
18+
19+
fn qux() {
20+
let mut i = 1i8;
21+
while 200 != i { //~ ERROR comparison is useless due to type limits
22+
i += 1;
23+
}
24+
}
25+

0 commit comments

Comments
 (0)
Please sign in to comment.