fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
4.8 KiB131 linesraw
1error: casting `i8` to `i16` may become silently lossy if you later change the type
2  --> $DIR/cast_lossless_integer.rs:6:13
3   |
4LL |     let _ = 1i8 as i16;
5   |             ^^^^^^^^^^ help: try: `i16::from(1i8)`
6   |
7   = note: `-D clippy::cast-lossless` implied by `-D warnings`
8   = help: to override `-D warnings` add `#[allow(clippy::cast_lossless)]`
9
10error: casting `i8` to `i32` may become silently lossy if you later change the type
11  --> $DIR/cast_lossless_integer.rs:7:13
12   |
13LL |     let _ = 1i8 as i32;
14   |             ^^^^^^^^^^ help: try: `i32::from(1i8)`
15
16error: casting `i8` to `i64` may become silently lossy if you later change the type
17  --> $DIR/cast_lossless_integer.rs:8:13
18   |
19LL |     let _ = 1i8 as i64;
20   |             ^^^^^^^^^^ help: try: `i64::from(1i8)`
21
22error: casting `u8` to `i16` may become silently lossy if you later change the type
23  --> $DIR/cast_lossless_integer.rs:9:13
24   |
25LL |     let _ = 1u8 as i16;
26   |             ^^^^^^^^^^ help: try: `i16::from(1u8)`
27
28error: casting `u8` to `i32` may become silently lossy if you later change the type
29  --> $DIR/cast_lossless_integer.rs:10:13
30   |
31LL |     let _ = 1u8 as i32;
32   |             ^^^^^^^^^^ help: try: `i32::from(1u8)`
33
34error: casting `u8` to `i64` may become silently lossy if you later change the type
35  --> $DIR/cast_lossless_integer.rs:11:13
36   |
37LL |     let _ = 1u8 as i64;
38   |             ^^^^^^^^^^ help: try: `i64::from(1u8)`
39
40error: casting `u8` to `u16` may become silently lossy if you later change the type
41  --> $DIR/cast_lossless_integer.rs:12:13
42   |
43LL |     let _ = 1u8 as u16;
44   |             ^^^^^^^^^^ help: try: `u16::from(1u8)`
45
46error: casting `u8` to `u32` may become silently lossy if you later change the type
47  --> $DIR/cast_lossless_integer.rs:13:13
48   |
49LL |     let _ = 1u8 as u32;
50   |             ^^^^^^^^^^ help: try: `u32::from(1u8)`
51
52error: casting `u8` to `u64` may become silently lossy if you later change the type
53  --> $DIR/cast_lossless_integer.rs:14:13
54   |
55LL |     let _ = 1u8 as u64;
56   |             ^^^^^^^^^^ help: try: `u64::from(1u8)`
57
58error: casting `i16` to `i32` may become silently lossy if you later change the type
59  --> $DIR/cast_lossless_integer.rs:15:13
60   |
61LL |     let _ = 1i16 as i32;
62   |             ^^^^^^^^^^^ help: try: `i32::from(1i16)`
63
64error: casting `i16` to `i64` may become silently lossy if you later change the type
65  --> $DIR/cast_lossless_integer.rs:16:13
66   |
67LL |     let _ = 1i16 as i64;
68   |             ^^^^^^^^^^^ help: try: `i64::from(1i16)`
69
70error: casting `u16` to `i32` may become silently lossy if you later change the type
71  --> $DIR/cast_lossless_integer.rs:17:13
72   |
73LL |     let _ = 1u16 as i32;
74   |             ^^^^^^^^^^^ help: try: `i32::from(1u16)`
75
76error: casting `u16` to `i64` may become silently lossy if you later change the type
77  --> $DIR/cast_lossless_integer.rs:18:13
78   |
79LL |     let _ = 1u16 as i64;
80   |             ^^^^^^^^^^^ help: try: `i64::from(1u16)`
81
82error: casting `u16` to `u32` may become silently lossy if you later change the type
83  --> $DIR/cast_lossless_integer.rs:19:13
84   |
85LL |     let _ = 1u16 as u32;
86   |             ^^^^^^^^^^^ help: try: `u32::from(1u16)`
87
88error: casting `u16` to `u64` may become silently lossy if you later change the type
89  --> $DIR/cast_lossless_integer.rs:20:13
90   |
91LL |     let _ = 1u16 as u64;
92   |             ^^^^^^^^^^^ help: try: `u64::from(1u16)`
93
94error: casting `i32` to `i64` may become silently lossy if you later change the type
95  --> $DIR/cast_lossless_integer.rs:21:13
96   |
97LL |     let _ = 1i32 as i64;
98   |             ^^^^^^^^^^^ help: try: `i64::from(1i32)`
99
100error: casting `u32` to `i64` may become silently lossy if you later change the type
101  --> $DIR/cast_lossless_integer.rs:22:13
102   |
103LL |     let _ = 1u32 as i64;
104   |             ^^^^^^^^^^^ help: try: `i64::from(1u32)`
105
106error: casting `u32` to `u64` may become silently lossy if you later change the type
107  --> $DIR/cast_lossless_integer.rs:23:13
108   |
109LL |     let _ = 1u32 as u64;
110   |             ^^^^^^^^^^^ help: try: `u64::from(1u32)`
111
112error: casting `u8` to `u16` may become silently lossy if you later change the type
113  --> $DIR/cast_lossless_integer.rs:26:13
114   |
115LL |     let _ = (1u8 + 1u8) as u16;
116   |             ^^^^^^^^^^^^^^^^^^ help: try: `u16::from(1u8 + 1u8)`
117
118error: casting `i8` to `i32` may become silently lossy if you later change the type
119  --> $DIR/cast_lossless_integer.rs:60:13
120   |
121LL |     let _ = sign_cast!(x, u8, i8) as i32;
122   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `i32::from(sign_cast!(x, u8, i8))`
123
124error: casting `i8` to `i32` may become silently lossy if you later change the type
125  --> $DIR/cast_lossless_integer.rs:61:13
126   |
127LL |     let _ = (sign_cast!(x, u8, i8) + 1) as i32;
128   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `i32::from(sign_cast!(x, u8, i8) + 1)`
129
130error: aborting due to 21 previous errors
131