Skip to content

improper_ctypes lint triggers for functions returning () #27302

Closed
@crumblingstatue

Description

@crumblingstatue

6fa17b4 made the improper_ctypes lint trigger for tuples, but as far as I understand, returning () is equivalent to returning c_void, and therefore should be allowed.

Here is an example:

extern "C" {
    pub fn foo() -> ();
}

fn main() {
}
foo.rs:2:21: 2:23 warning: found Rust tuple type in foreign module; consider using a struct instead`, #[warn(improper_ctypes)] on by default
foo.rs:2     pub fn foo() -> ();
                             ^~

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lints

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions