Skip to content

unsafe extern support (undocumented_unsafe_blocks?) #13560

Open

Description

What it does

Rust 1.80.0 allows writing unsafe extern under feature(unsafe_extern_blocks), Rust 1.82.0 stabilizes it, and Edition 2024 will require it. Thus it would be nice to have a lint that ensures // SAFETY comments are in place.

undocumented_unsafe_blocks covers not just unsafe blocks (at least currently), so it could make sense to put it there, but it may make more sense to avoid adding more things into that one.

Advantage

No response

Drawbacks

No response

Example

unsafe extern {}

Should be written as:

// SAFETY: ...
unsafe extern {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    A-lintArea: New lints

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions