Skip to content

Error generation #3235

Open
Open
@topcoco

Description

@topcoco

error[E0740]: field must implement Copy or be wrapped in ManuallyDrop<...> to be used in a union
--> ./open/162/generated_bindings.rs:12:5
|
12 | pub _M_val: _Tp,
| ^^^^^^^^^^^^^^^
|
= note: union fields must not have drop side-effects, which is currently enforced via either Copy or ManuallyDrop<...>
help: wrap the field type in ManuallyDrop<...>
|
12 | pub _M_val: std::mem::ManuallyDrop<_Tp>,
| +++++++++++++++++++++++ +

error: aborting due to 1 previous error

For more information about this error, try rustc --explain E0740.

#[repr(C)]
pub union std_vector__Temporary_value__Storage<_Tp> {
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<_Tp>>,
pub _M_byte: ::std::os::raw::c_uchar,
pub _M_val: _Tp, //Error generation
}

#[repr(C)]
pub union std_vector__Temporary_value__Storage<_Tp> {
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<_Tp>>,
pub _M_byte: ::std::os::raw::c_uchar,
pub _M_val: ManuallyDrop<_Tp>, //Changing it to this compilation can be passed
}

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