Commit 50a7782
committed
Avoid direct casts from function to integer
Current nightly warns about direct casts from function to integer:
```
warning: direct cast of function item into an integer
--> .../rp235x-hal/src/multicore.rs:371:36
|
371 | core1_startup::<F> as usize,
| ^^^^^^^^
|
= note: `#[warn(function_casts_as_integer)]` on by default
help: first cast to a pointer `as *const ()`
|
371 | core1_startup::<F> as *const () as usize,
| ++++++++++++
```
In our case the cast is intended, so apply the suggested fix.
As an alternative to `*const ()` for the intermediate step, one could
also use the actual fn type. However, in this case, that would be a
rather long signature:
`core1_startup::<F> as extern "C" fn(u64, u64, *mut core::mem::ManuallyDrop<F>, *mut usize) -> ! as usize`
So I think here it's better to use the `*const ()` shortcut.1 parent 28fdf0c commit 50a7782
2 files changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
348 | 348 | | |
349 | 349 | | |
350 | 350 | | |
351 | | - | |
| 351 | + | |
352 | 352 | | |
353 | 353 | | |
354 | 354 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
368 | 368 | | |
369 | 369 | | |
370 | 370 | | |
371 | | - | |
| 371 | + | |
372 | 372 | | |
373 | 373 | | |
374 | 374 | | |
| |||
0 commit comments