Skip to content

Empty structs should not need #[repr(C)] #750

@steveklabnik

Description

@steveklabnik

Issue by cgaebel
Thursday Nov 06, 2014 at 07:50 GMT

For earlier discussion, see rust-lang/rust#18686

This issue was labelled with: in the Rust repository


In a lot of FFI code, I see patterns like:

struct X {}

fn some_c_function(this: *mut X);

where X is used as an opaque "black-box" object. With rust today, X needs a #[repr(C)]. That's not really necessary, and caused a bunch of noisy warnings when updating servo's rust version.

Can someone mark this bug as easy so a beginner can use it to get started?

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-langRelevant to the language team, which will review and decide on the RFC.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions