1error: casting function pointer `foo` to `i8`, which truncates the value
2  --> $DIR/fn_to_numeric_cast.rs:10:13
3   |
4LL |     let _ = foo as i8;
5   |             ^^^^^^^^^ help: try: `foo as usize`
6   |
7   = note: `-D clippy::fn-to-numeric-cast-with-truncation` implied by `-D warnings`
8
9error: casting function pointer `foo` to `i16`, which truncates the value
10  --> $DIR/fn_to_numeric_cast.rs:11:13
11   |
12LL |     let _ = foo as i16;
13   |             ^^^^^^^^^^ help: try: `foo as usize`
14
15error: casting function pointer `foo` to `i32`, which truncates the value
16  --> $DIR/fn_to_numeric_cast.rs:12:13
17   |
18LL |     let _ = foo as i32;
19   |             ^^^^^^^^^^ help: try: `foo as usize`
20
21error: casting function pointer `foo` to `i64`
22  --> $DIR/fn_to_numeric_cast.rs:13:13
23   |
24LL |     let _ = foo as i64;
25   |             ^^^^^^^^^^ help: try: `foo as usize`
26   |
27   = note: `-D clippy::fn-to-numeric-cast` implied by `-D warnings`
28
29error: casting function pointer `foo` to `i128`
30  --> $DIR/fn_to_numeric_cast.rs:14:13
31   |
32LL |     let _ = foo as i128;
33   |             ^^^^^^^^^^^ help: try: `foo as usize`
34
35error: casting function pointer `foo` to `isize`
36  --> $DIR/fn_to_numeric_cast.rs:15:13
37   |
38LL |     let _ = foo as isize;
39   |             ^^^^^^^^^^^^ help: try: `foo as usize`
40
41error: casting function pointer `foo` to `u8`, which truncates the value
42  --> $DIR/fn_to_numeric_cast.rs:17:13
43   |
44LL |     let _ = foo as u8;
45   |             ^^^^^^^^^ help: try: `foo as usize`
46
47error: casting function pointer `foo` to `u16`, which truncates the value
48  --> $DIR/fn_to_numeric_cast.rs:18:13
49   |
50LL |     let _ = foo as u16;
51   |             ^^^^^^^^^^ help: try: `foo as usize`
52
53error: casting function pointer `foo` to `u32`, which truncates the value
54  --> $DIR/fn_to_numeric_cast.rs:19:13
55   |
56LL |     let _ = foo as u32;
57   |             ^^^^^^^^^^ help: try: `foo as usize`
58
59error: casting function pointer `foo` to `u64`
60  --> $DIR/fn_to_numeric_cast.rs:20:13
61   |
62LL |     let _ = foo as u64;
63   |             ^^^^^^^^^^ help: try: `foo as usize`
64
65error: casting function pointer `foo` to `u128`
66  --> $DIR/fn_to_numeric_cast.rs:21:13
67   |
68LL |     let _ = foo as u128;
69   |             ^^^^^^^^^^^ help: try: `foo as usize`
70
71error: casting function pointer `abc` to `i8`, which truncates the value
72  --> $DIR/fn_to_numeric_cast.rs:34:13
73   |
74LL |     let _ = abc as i8;
75   |             ^^^^^^^^^ help: try: `abc as usize`
76
77error: casting function pointer `abc` to `i16`, which truncates the value
78  --> $DIR/fn_to_numeric_cast.rs:35:13
79   |
80LL |     let _ = abc as i16;
81   |             ^^^^^^^^^^ help: try: `abc as usize`
82
83error: casting function pointer `abc` to `i32`, which truncates the value
84  --> $DIR/fn_to_numeric_cast.rs:36:13
85   |
86LL |     let _ = abc as i32;
87   |             ^^^^^^^^^^ help: try: `abc as usize`
88
89error: casting function pointer `abc` to `i64`
90  --> $DIR/fn_to_numeric_cast.rs:37:13
91   |
92LL |     let _ = abc as i64;
93   |             ^^^^^^^^^^ help: try: `abc as usize`
94
95error: casting function pointer `abc` to `i128`
96  --> $DIR/fn_to_numeric_cast.rs:38:13
97   |
98LL |     let _ = abc as i128;
99   |             ^^^^^^^^^^^ help: try: `abc as usize`
100
101error: casting function pointer `abc` to `isize`
102  --> $DIR/fn_to_numeric_cast.rs:39:13
103   |
104LL |     let _ = abc as isize;
105   |             ^^^^^^^^^^^^ help: try: `abc as usize`
106
107error: casting function pointer `abc` to `u8`, which truncates the value
108  --> $DIR/fn_to_numeric_cast.rs:41:13
109   |
110LL |     let _ = abc as u8;
111   |             ^^^^^^^^^ help: try: `abc as usize`
112
113error: casting function pointer `abc` to `u16`, which truncates the value
114  --> $DIR/fn_to_numeric_cast.rs:42:13
115   |
116LL |     let _ = abc as u16;
117   |             ^^^^^^^^^^ help: try: `abc as usize`
118
119error: casting function pointer `abc` to `u32`, which truncates the value
120  --> $DIR/fn_to_numeric_cast.rs:43:13
121   |
122LL |     let _ = abc as u32;
123   |             ^^^^^^^^^^ help: try: `abc as usize`
124
125error: casting function pointer `abc` to `u64`
126  --> $DIR/fn_to_numeric_cast.rs:44:13
127   |
128LL |     let _ = abc as u64;
129   |             ^^^^^^^^^^ help: try: `abc as usize`
130
131error: casting function pointer `abc` to `u128`
132  --> $DIR/fn_to_numeric_cast.rs:45:13
133   |
134LL |     let _ = abc as u128;
135   |             ^^^^^^^^^^^ help: try: `abc as usize`
136
137error: casting function pointer `f` to `i32`, which truncates the value
138  --> $DIR/fn_to_numeric_cast.rs:52:5
139   |
140LL |     f as i32
141   |     ^^^^^^^^ help: try: `f as usize`
142
143error: aborting due to 23 previous errors
144
145