summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/fn_to_numeric_cast.stderr
blob: e9549e157cd91deb06f1677ca7f52be6edee7ef3 (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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
error: casting function pointer `foo` to `i8`, which truncates the value
  --> $DIR/fn_to_numeric_cast.rs:10:13
   |
LL |     let _ = foo as i8;
   |             ^^^^^^^^^ help: try: `foo as usize`
   |
   = note: `-D clippy::fn-to-numeric-cast-with-truncation` implied by `-D warnings`

error: casting function pointer `foo` to `i16`, which truncates the value
  --> $DIR/fn_to_numeric_cast.rs:11:13
   |
LL |     let _ = foo as i16;
   |             ^^^^^^^^^^ help: try: `foo as usize`

error: casting function pointer `foo` to `i32`, which truncates the value
  --> $DIR/fn_to_numeric_cast.rs:12:13
   |
LL |     let _ = foo as i32;
   |             ^^^^^^^^^^ help: try: `foo as usize`

error: casting function pointer `foo` to `i64`
  --> $DIR/fn_to_numeric_cast.rs:13:13
   |
LL |     let _ = foo as i64;
   |             ^^^^^^^^^^ help: try: `foo as usize`
   |
   = note: `-D clippy::fn-to-numeric-cast` implied by `-D warnings`

error: casting function pointer `foo` to `i128`
  --> $DIR/fn_to_numeric_cast.rs:14:13
   |
LL |     let _ = foo as i128;
   |             ^^^^^^^^^^^ help: try: `foo as usize`

error: casting function pointer `foo` to `isize`
  --> $DIR/fn_to_numeric_cast.rs:15:13
   |
LL |     let _ = foo as isize;
   |             ^^^^^^^^^^^^ help: try: `foo as usize`

error: casting function pointer `foo` to `u8`, which truncates the value
  --> $DIR/fn_to_numeric_cast.rs:17:13
   |
LL |     let _ = foo as u8;
   |             ^^^^^^^^^ help: try: `foo as usize`

error: casting function pointer `foo` to `u16`, which truncates the value
  --> $DIR/fn_to_numeric_cast.rs:18:13
   |
LL |     let _ = foo as u16;
   |             ^^^^^^^^^^ help: try: `foo as usize`

error: casting function pointer `foo` to `u32`, which truncates the value
  --> $DIR/fn_to_numeric_cast.rs:19:13
   |
LL |     let _ = foo as u32;
   |             ^^^^^^^^^^ help: try: `foo as usize`

error: casting function pointer `foo` to `u64`
  --> $DIR/fn_to_numeric_cast.rs:20:13
   |
LL |     let _ = foo as u64;
   |             ^^^^^^^^^^ help: try: `foo as usize`

error: casting function pointer `foo` to `u128`
  --> $DIR/fn_to_numeric_cast.rs:21:13
   |
LL |     let _ = foo as u128;
   |             ^^^^^^^^^^^ help: try: `foo as usize`

error: casting function pointer `abc` to `i8`, which truncates the value
  --> $DIR/fn_to_numeric_cast.rs:34:13
   |
LL |     let _ = abc as i8;
   |             ^^^^^^^^^ help: try: `abc as usize`

error: casting function pointer `abc` to `i16`, which truncates the value
  --> $DIR/fn_to_numeric_cast.rs:35:13
   |
LL |     let _ = abc as i16;
   |             ^^^^^^^^^^ help: try: `abc as usize`

error: casting function pointer `abc` to `i32`, which truncates the value
  --> $DIR/fn_to_numeric_cast.rs:36:13
   |
LL |     let _ = abc as i32;
   |             ^^^^^^^^^^ help: try: `abc as usize`

error: casting function pointer `abc` to `i64`
  --> $DIR/fn_to_numeric_cast.rs:37:13
   |
LL |     let _ = abc as i64;
   |             ^^^^^^^^^^ help: try: `abc as usize`

error: casting function pointer `abc` to `i128`
  --> $DIR/fn_to_numeric_cast.rs:38:13
   |
LL |     let _ = abc as i128;
   |             ^^^^^^^^^^^ help: try: `abc as usize`

error: casting function pointer `abc` to `isize`
  --> $DIR/fn_to_numeric_cast.rs:39:13
   |
LL |     let _ = abc as isize;
   |             ^^^^^^^^^^^^ help: try: `abc as usize`

error: casting function pointer `abc` to `u8`, which truncates the value
  --> $DIR/fn_to_numeric_cast.rs:41:13
   |
LL |     let _ = abc as u8;
   |             ^^^^^^^^^ help: try: `abc as usize`

error: casting function pointer `abc` to `u16`, which truncates the value
  --> $DIR/fn_to_numeric_cast.rs:42:13
   |
LL |     let _ = abc as u16;
   |             ^^^^^^^^^^ help: try: `abc as usize`

error: casting function pointer `abc` to `u32`, which truncates the value
  --> $DIR/fn_to_numeric_cast.rs:43:13
   |
LL |     let _ = abc as u32;
   |             ^^^^^^^^^^ help: try: `abc as usize`

error: casting function pointer `abc` to `u64`
  --> $DIR/fn_to_numeric_cast.rs:44:13
   |
LL |     let _ = abc as u64;
   |             ^^^^^^^^^^ help: try: `abc as usize`

error: casting function pointer `abc` to `u128`
  --> $DIR/fn_to_numeric_cast.rs:45:13
   |
LL |     let _ = abc as u128;
   |             ^^^^^^^^^^^ help: try: `abc as usize`

error: casting function pointer `f` to `i32`, which truncates the value
  --> $DIR/fn_to_numeric_cast.rs:52:5
   |
LL |     f as i32
   |     ^^^^^^^^ help: try: `f as usize`

error: aborting due to 23 previous errors