We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 87b5f05 commit 0707780Copy full SHA for 0707780
src/test/compile-fail/lint-type-limits.rs
@@ -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