summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/checked_conversions.stderr
blob: b2bf7af8daf87a8df2b6a723a1b72ee53dc882c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
error: checked cast can be simplified
  --> $DIR/checked_conversions.rs:17:13
   |
LL |     let _ = value <= (u32::max_value() as i64) && value >= 0;
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `u32::try_from(value).is_ok()`
   |
   = note: `-D clippy::checked-conversions` implied by `-D warnings`

error: checked cast can be simplified
  --> $DIR/checked_conversions.rs:18:13
   |
LL |     let _ = value <= (u32::MAX as i64) && value >= 0;
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `u32::try_from(value).is_ok()`

error: checked cast can be simplified
  --> $DIR/checked_conversions.rs:22:13
   |
LL |     let _ = value <= i64::from(u16::max_value()) && value >= 0;
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `u16::try_from(value).is_ok()`

error: checked cast can be simplified
  --> $DIR/checked_conversions.rs:23:13
   |
LL |     let _ = value <= i64::from(u16::MAX) && value >= 0;
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `u16::try_from(value).is_ok()`

error: checked cast can be simplified
  --> $DIR/checked_conversions.rs:27:13
   |
LL |     let _ = value <= (u8::max_value() as isize) && value >= 0;
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `u8::try_from(value).is_ok()`

error: checked cast can be simplified
  --> $DIR/checked_conversions.rs:28:13
   |
LL |     let _ = value <= (u8::MAX as isize) && value >= 0;
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `u8::try_from(value).is_ok()`

error: checked cast can be simplified
  --> $DIR/checked_conversions.rs:34:13
   |
LL |     let _ = value <= (i32::max_value() as i64) && value >= (i32::min_value() as i64);
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `i32::try_from(value).is_ok()`

error: checked cast can be simplified
  --> $DIR/checked_conversions.rs:35:13
   |
LL |     let _ = value <= (i32::MAX as i64) && value >= (i32::MIN as i64);
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `i32::try_from(value).is_ok()`

error: checked cast can be simplified
  --> $DIR/checked_conversions.rs:39:13
   |
LL |     let _ = value <= i64::from(i16::max_value()) && value >= i64::from(i16::min_value());
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `i16::try_from(value).is_ok()`

error: checked cast can be simplified
  --> $DIR/checked_conversions.rs:40:13
   |
LL |     let _ = value <= i64::from(i16::MAX) && value >= i64::from(i16::MIN);
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `i16::try_from(value).is_ok()`

error: checked cast can be simplified
  --> $DIR/checked_conversions.rs:46:13
   |
LL |     let _ = value <= i32::max_value() as u32;
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `i32::try_from(value).is_ok()`

error: checked cast can be simplified
  --> $DIR/checked_conversions.rs:47:13
   |
LL |     let _ = value <= i32::MAX as u32;
   |             ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `i32::try_from(value).is_ok()`

error: checked cast can be simplified
  --> $DIR/checked_conversions.rs:51:13
   |
LL |     let _ = value <= isize::max_value() as usize && value as i32 == 5;
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `isize::try_from(value).is_ok()`

error: checked cast can be simplified
  --> $DIR/checked_conversions.rs:52:13
   |
LL |     let _ = value <= isize::MAX as usize && value as i32 == 5;
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `isize::try_from(value).is_ok()`

error: checked cast can be simplified
  --> $DIR/checked_conversions.rs:56:13
   |
LL |     let _ = value <= u16::max_value() as u32 && value as i32 == 5;
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `u16::try_from(value).is_ok()`

error: checked cast can be simplified
  --> $DIR/checked_conversions.rs:57:13
   |
LL |     let _ = value <= u16::MAX as u32 && value as i32 == 5;
   |             ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `u16::try_from(value).is_ok()`

error: checked cast can be simplified
  --> $DIR/checked_conversions.rs:92:13
   |
LL |     let _ = value <= (u32::MAX as i64) && value >= 0;
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `u32::try_from(value).is_ok()`

error: aborting due to 17 previous errors