blob: ba90df2059af65045812387160c026e95ef765e1 (
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
|
error: casting function pointer `u16::max` to `usize`
--> tests/ui/confusing_method_to_numeric_cast.rs:5:13
|
LL | let _ = u16::max as usize;
| ^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::confusing-method-to-numeric-cast` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::confusing_method_to_numeric_cast)]`
help: did you mean to use the associated constant?
|
LL - let _ = u16::max as usize;
LL + let _ = u16::MAX as usize;
|
error: casting function pointer `u16::min` to `usize`
--> tests/ui/confusing_method_to_numeric_cast.rs:6:13
|
LL | let _ = u16::min as usize;
| ^^^^^^^^^^^^^^^^^
|
help: did you mean to use the associated constant?
|
LL - let _ = u16::min as usize;
LL + let _ = u16::MIN as usize;
|
error: casting function pointer `u16::max_value` to `usize`
--> tests/ui/confusing_method_to_numeric_cast.rs:7:13
|
LL | let _ = u16::max_value as usize;
| ^^^^^^^^^^^^^^^^^^^^^^^
|
help: did you mean to use the associated constant?
|
LL - let _ = u16::max_value as usize;
LL + let _ = u16::MAX as usize;
|
error: casting function pointer `u16::min_value` to `usize`
--> tests/ui/confusing_method_to_numeric_cast.rs:8:13
|
LL | let _ = u16::min_value as usize;
| ^^^^^^^^^^^^^^^^^^^^^^^
|
help: did you mean to use the associated constant?
|
LL - let _ = u16::min_value as usize;
LL + let _ = u16::MIN as usize;
|
error: casting function pointer `f32::maximum` to `usize`
--> tests/ui/confusing_method_to_numeric_cast.rs:10:13
|
LL | let _ = f32::maximum as usize;
| ^^^^^^^^^^^^^^^^^^^^^
|
help: did you mean to use the associated constant?
|
LL - let _ = f32::maximum as usize;
LL + let _ = f32::MAX as usize;
|
error: casting function pointer `f32::max` to `usize`
--> tests/ui/confusing_method_to_numeric_cast.rs:11:13
|
LL | let _ = f32::max as usize;
| ^^^^^^^^^^^^^^^^^
|
help: did you mean to use the associated constant?
|
LL - let _ = f32::max as usize;
LL + let _ = f32::MAX as usize;
|
error: casting function pointer `f32::minimum` to `usize`
--> tests/ui/confusing_method_to_numeric_cast.rs:12:13
|
LL | let _ = f32::minimum as usize;
| ^^^^^^^^^^^^^^^^^^^^^
|
help: did you mean to use the associated constant?
|
LL - let _ = f32::minimum as usize;
LL + let _ = f32::MIN as usize;
|
error: casting function pointer `f32::min` to `usize`
--> tests/ui/confusing_method_to_numeric_cast.rs:13:13
|
LL | let _ = f32::min as usize;
| ^^^^^^^^^^^^^^^^^
|
help: did you mean to use the associated constant?
|
LL - let _ = f32::min as usize;
LL + let _ = f32::MIN as usize;
|
error: aborting due to 8 previous errors
|