Skip to content

improper_ctypes lint allows all "Option-like" enums, but we only guarantee this specifically for Option #130652

Closed
@RalfJung

Description

@RalfJung

Ever since its introduction, the FFI safety lint has accepted MyOption<Box<T>> as FFI safe even if MyOption is not the "official" Option type from libcore. This was originally done because "being sound but slightly incomplete is acceptable". However, it doesn't quite reflect today's approaches any more, and IMO the lint should be adjusted to match the documented guarantees -- which AFAIK only cover specifically Option, and not all "Option-like" types.

Cc @rust-lang/opsem @workingjubilee @Noratrieb

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-FFIArea: Foreign function interface (FFI)A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.L-improper_ctypesLint: improper_ctypesT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-langRelevant to the language team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions