From 44ab23703a1a6c4ff0e15a3b3e20284f6a9053fb Mon Sep 17 00:00:00 2001 From: Taylor Cramer Date: Mon, 28 Mar 2016 22:08:58 -0700 Subject: [PATCH] Added tests for eq and neq invalid upcast comparisons --- tests/compile-fail/invalid_upcast_comparisons.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/compile-fail/invalid_upcast_comparisons.rs b/tests/compile-fail/invalid_upcast_comparisons.rs index 263e74e5f4a..6ccba368e62 100644 --- a/tests/compile-fail/invalid_upcast_comparisons.rs +++ b/tests/compile-fail/invalid_upcast_comparisons.rs @@ -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 }