Skip to content

Lint to disallow using as for pointer casts in favor of .cast() #5890

@retep998

Description

@retep998

What it does

Any raw pointer cast from *const T to *const U or *mut T to *mut U that uses as should be caught by this lint. Instead you should use .cast().

Should probably be a pedantic lint.

Drawbacks

None.

Example

foo as *const c_void

Could be written as:

foo.cast()

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintArea: New lintsE-mediumCall for participation: Medium difficulty level problem and requires some initial experience.L-suggestionLint: Improving, adding or fixing lint suggestions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions