]> git.lizzy.rs Git - rust.git/commitdiff
Added > and >= tests for upcast comparisons
authorTaylor Cramer <cramertj@cs.washington.edu>
Tue, 29 Mar 2016 04:44:18 +0000 (21:44 -0700)
committermcarton <cartonmartin+git@gmail.com>
Sat, 2 Apr 2016 13:32:57 +0000 (15:32 +0200)
tests/compile-fail/invalid_upcast_comparisons.rs

index f94b4959287c3d6426632e3d379d69075619b3eb..263e74e5f4a02c936ae248cc607b5e7527ac28ef 100644 (file)
@@ -16,4 +16,7 @@ fn main() {
     -5 < (zero as i32); //~ERROR because of the numeric bounds on `zero` prior to casting, this expression is always true
     0 <= (zero as i32); //~ERROR because of the numeric bounds on `zero` prior to casting, this expression is always true
     0 < (zero as i32);
+
+    -5 > (zero as i32); //~ERROR because of the numeric bounds on `zero` prior to casting, this expression is always false
+    -5 >= (u8_max as i32); //~ERROR because of the numeric bounds on `u8_max` prior to casting, this expression is always false
 }