]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/invalid_upcast_comparisons.stderr
Auto merge of #9684 - kraktus:ref_option_ref, r=xFrednet
[rust.git] / tests / ui / invalid_upcast_comparisons.stderr
index e7eda752f38801c1417edd5999c89e4dbe906dc5..03c3fb80aaabcc1f5adbee634ad8bf256de77b4e 100644 (file)
-error: because of the numeric bounds on `u8_max` prior to casting, this expression is always false
-  --> $DIR/invalid_upcast_comparisons.rs:10:5
+error: because of the numeric bounds on `u8` prior to casting, this expression is always false
+  --> $DIR/invalid_upcast_comparisons.rs:21:5
    |
-10 |     (u8_max as u32) > 300;
-   |     ^^^^^^^^^^^^^^^^^^^^^
+LL |     (u8 as u32) > 300;
+   |     ^^^^^^^^^^^^^^^^^
    |
-note: lint level defined here
-  --> $DIR/invalid_upcast_comparisons.rs:4:9
+   = note: `-D clippy::invalid-upcast-comparisons` implied by `-D warnings`
+
+error: because of the numeric bounds on `u8` prior to casting, this expression is always false
+  --> $DIR/invalid_upcast_comparisons.rs:22:5
    |
-4  | #![deny(invalid_upcast_comparisons)]
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL |     (u8 as i32) > 300;
+   |     ^^^^^^^^^^^^^^^^^
 
-error: because of the numeric bounds on `zero` prior to casting, this expression is always false
-  --> $DIR/invalid_upcast_comparisons.rs:13:5
+error: because of the numeric bounds on `u8` prior to casting, this expression is always false
+  --> $DIR/invalid_upcast_comparisons.rs:23:5
    |
-13 |     (zero as i32) < -5;
+LL |     (u8 as u32) == 300;
    |     ^^^^^^^^^^^^^^^^^^
 
-error: because of the numeric bounds on `zero` prior to casting, this expression is always true
-  --> $DIR/invalid_upcast_comparisons.rs:16:5
+error: because of the numeric bounds on `u8` prior to casting, this expression is always false
+  --> $DIR/invalid_upcast_comparisons.rs:24:5
    |
-16 |     -5 < (zero as i32);
+LL |     (u8 as i32) == 300;
    |     ^^^^^^^^^^^^^^^^^^
 
-error: because of the numeric bounds on `zero` prior to casting, this expression is always true
-  --> $DIR/invalid_upcast_comparisons.rs:17:5
+error: because of the numeric bounds on `u8` prior to casting, this expression is always false
+  --> $DIR/invalid_upcast_comparisons.rs:25:5
+   |
+LL |     300 < (u8 as u32);
+   |     ^^^^^^^^^^^^^^^^^
+
+error: because of the numeric bounds on `u8` prior to casting, this expression is always false
+  --> $DIR/invalid_upcast_comparisons.rs:26:5
    |
-17 |     0 <= (zero as i32);
+LL |     300 < (u8 as i32);
+   |     ^^^^^^^^^^^^^^^^^
+
+error: because of the numeric bounds on `u8` prior to casting, this expression is always false
+  --> $DIR/invalid_upcast_comparisons.rs:27:5
+   |
+LL |     300 == (u8 as u32);
    |     ^^^^^^^^^^^^^^^^^^
 
-error: because of the numeric bounds on `zero` prior to casting, this expression is always false
-  --> $DIR/invalid_upcast_comparisons.rs:20:5
+error: because of the numeric bounds on `u8` prior to casting, this expression is always false
+  --> $DIR/invalid_upcast_comparisons.rs:28:5
    |
-20 |     -5 > (zero as i32);
+LL |     300 == (u8 as i32);
    |     ^^^^^^^^^^^^^^^^^^
 
-error: because of the numeric bounds on `u8_max` prior to casting, this expression is always false
-  --> $DIR/invalid_upcast_comparisons.rs:21:5
+error: because of the numeric bounds on `u8` prior to casting, this expression is always true
+  --> $DIR/invalid_upcast_comparisons.rs:30:5
    |
-21 |     -5 >= (u8_max as i32);
-   |     ^^^^^^^^^^^^^^^^^^^^^
+LL |     (u8 as u32) <= 300;
+   |     ^^^^^^^^^^^^^^^^^^
 
-error: because of the numeric bounds on `u8_max` prior to casting, this expression is always false
-  --> $DIR/invalid_upcast_comparisons.rs:22:5
+error: because of the numeric bounds on `u8` prior to casting, this expression is always true
+  --> $DIR/invalid_upcast_comparisons.rs:31:5
    |
-22 |     1337 == (u8_max as i32);
-   |     ^^^^^^^^^^^^^^^^^^^^^^^
+LL |     (u8 as i32) <= 300;
+   |     ^^^^^^^^^^^^^^^^^^
 
-error: because of the numeric bounds on `zero` prior to casting, this expression is always false
-  --> $DIR/invalid_upcast_comparisons.rs:24:5
+error: because of the numeric bounds on `u8` prior to casting, this expression is always true
+  --> $DIR/invalid_upcast_comparisons.rs:32:5
+   |
+LL |     (u8 as u32) != 300;
+   |     ^^^^^^^^^^^^^^^^^^
+
+error: because of the numeric bounds on `u8` prior to casting, this expression is always true
+  --> $DIR/invalid_upcast_comparisons.rs:33:5
+   |
+LL |     (u8 as i32) != 300;
+   |     ^^^^^^^^^^^^^^^^^^
+
+error: because of the numeric bounds on `u8` prior to casting, this expression is always true
+  --> $DIR/invalid_upcast_comparisons.rs:34:5
+   |
+LL |     300 >= (u8 as u32);
+   |     ^^^^^^^^^^^^^^^^^^
+
+error: because of the numeric bounds on `u8` prior to casting, this expression is always true
+  --> $DIR/invalid_upcast_comparisons.rs:35:5
+   |
+LL |     300 >= (u8 as i32);
+   |     ^^^^^^^^^^^^^^^^^^
+
+error: because of the numeric bounds on `u8` prior to casting, this expression is always true
+  --> $DIR/invalid_upcast_comparisons.rs:36:5
+   |
+LL |     300 != (u8 as u32);
+   |     ^^^^^^^^^^^^^^^^^^
+
+error: because of the numeric bounds on `u8` prior to casting, this expression is always true
+  --> $DIR/invalid_upcast_comparisons.rs:37:5
+   |
+LL |     300 != (u8 as i32);
+   |     ^^^^^^^^^^^^^^^^^^
+
+error: because of the numeric bounds on `u8` prior to casting, this expression is always false
+  --> $DIR/invalid_upcast_comparisons.rs:40:5
+   |
+LL |     (u8 as i32) < 0;
+   |     ^^^^^^^^^^^^^^^
+
+error: because of the numeric bounds on `u8` prior to casting, this expression is always true
+  --> $DIR/invalid_upcast_comparisons.rs:41:5
    |
-24 |     -5 == (zero as i32);
+LL |     -5 != (u8 as i32);
+   |     ^^^^^^^^^^^^^^^^^
+
+error: because of the numeric bounds on `u8` prior to casting, this expression is always true
+  --> $DIR/invalid_upcast_comparisons.rs:43:5
+   |
+LL |     (u8 as i32) >= 0;
+   |     ^^^^^^^^^^^^^^^^
+
+error: because of the numeric bounds on `u8` prior to casting, this expression is always false
+  --> $DIR/invalid_upcast_comparisons.rs:44:5
+   |
+LL |     -5 == (u8 as i32);
+   |     ^^^^^^^^^^^^^^^^^
+
+error: because of the numeric bounds on `u8` prior to casting, this expression is always false
+  --> $DIR/invalid_upcast_comparisons.rs:47:5
+   |
+LL |     1337 == (u8 as i32);
    |     ^^^^^^^^^^^^^^^^^^^
 
-error: because of the numeric bounds on `u8_max` prior to casting, this expression is always true
-  --> $DIR/invalid_upcast_comparisons.rs:25:5
+error: because of the numeric bounds on `u8` prior to casting, this expression is always false
+  --> $DIR/invalid_upcast_comparisons.rs:48:5
+   |
+LL |     1337 == (u8 as u32);
+   |     ^^^^^^^^^^^^^^^^^^^
+
+error: because of the numeric bounds on `u8` prior to casting, this expression is always true
+  --> $DIR/invalid_upcast_comparisons.rs:50:5
+   |
+LL |     1337 != (u8 as i32);
+   |     ^^^^^^^^^^^^^^^^^^^
+
+error: because of the numeric bounds on `u8` prior to casting, this expression is always true
+  --> $DIR/invalid_upcast_comparisons.rs:51:5
+   |
+LL |     1337 != (u8 as u32);
+   |     ^^^^^^^^^^^^^^^^^^^
+
+error: because of the numeric bounds on `u8` prior to casting, this expression is always true
+  --> $DIR/invalid_upcast_comparisons.rs:65:5
+   |
+LL |     (u8 as i32) > -1;
+   |     ^^^^^^^^^^^^^^^^
+
+error: because of the numeric bounds on `u8` prior to casting, this expression is always false
+  --> $DIR/invalid_upcast_comparisons.rs:66:5
+   |
+LL |     (u8 as i32) < -1;
+   |     ^^^^^^^^^^^^^^^^
+
+error: because of the numeric bounds on `u8` prior to casting, this expression is always false
+  --> $DIR/invalid_upcast_comparisons.rs:82:5
    |
-25 |     -5 != (u8_max as i32);
-   |     ^^^^^^^^^^^^^^^^^^^^^
+LL |     -5 >= (u8 as i32);
+   |     ^^^^^^^^^^^^^^^^^
 
-error: aborting due to 9 previous errors
+error: aborting due to 27 previous errors