Skip to content

Copy is not being derived when referring to a blocklisted type #3436

Description

@Quant1um

I am using blocklist_file to control which items go into which generated binding files, and I manually add the imports so everything compiles fine.
The issue is that when a struct references another type that has been blocklisted it doesn't add a #[derive(Copy)] to that type.

An example:

// This works fine:
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct xcb_input_device_key_state_notify_event_t {
    pub response_type: u8,
    pub device_id: u8,
    pub sequence: u16,
    pub keys: [u8; 28usize],
}

// This doesn't:
#[repr(C)]
pub struct xcb_input_change_device_notify_event_t {
    pub response_type: u8,
    pub device_id: u8,
    pub sequence: u16,
    pub time: xcb_timestamp_t, // this is a type alias to u32 which is defined in a header that has been block-listed while generating the bindings for that file
    pub request: u8,
    pub pad0: [u8; 23usize],
}

Is this intended behavior? Is there a workaround?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions