Skip to content

Commit

Permalink
Added tests for eq and neq invalid upcast comparisons
Browse files Browse the repository at this point in the history
  • Loading branch information
cramertj authored and mcarton committed Apr 2, 2016
1 parent d050d60 commit 44ab237
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/compile-fail/invalid_upcast_comparisons.rs
Expand Up @@ -19,4 +19,7 @@ fn main() {

-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

-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 true
}

0 comments on commit 44ab237

Please sign in to comment.