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