Skip to content

False Suggestion for const fn #5192

Closed
@Demonstrandum

Description

@Demonstrandum
cargo clippy -V
#=> clippy 0.0.212 (07f1736 2020-02-11)
warning: this could be a `const fn`
  --> src/vm/unmarshal.rs:23:1
   |
23 | / fn fix_slice_size<T, const N : usize>(slice : &[T]) -> &[T; N] {
24 | |     let ptr = slice.as_ptr() as *const [T; N];
25 | |     unsafe { &*ptr }
26 | | }
   | |_^
   |

This is a false suggestion, since const parameters are not permitted in const fn.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: Clippy is not doing the correct thingT-const-genericsType: Issues related to const genericsgood first issueThese issues are a good way to get started with Clippy

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions