Skip to content

unsafe-blocks lint should forbid unsafe impl #22430

Closed
@kmcallister

Description

@kmcallister

This program compiles:

#![forbid(unsafe_blocks)]

unsafe trait Foo { }

struct Bar;

unsafe impl Foo for Bar { }

fn main() { }

We should have a lint that forbids all use of the unsafe dialect, including unsafe impl. Probably this entails renaming the unsafe-blocks lint.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.A-trait-systemArea: Trait system

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions