Skip to content

Should autocxx::c_* newtypes implement Copy? #580

@WilliamVenner

Description

@WilliamVenner

Hi,

I noticed that the wrapped C types autocxx exposes do not implement Copy - only Clone, despite most of them having Copy implemented on the underlying type - is this intentional?

autocxx/src/lib.rs

Lines 620 to 633 in 4e96dfd

macro_rules! ctype_wrapper {
($r:ident, $c:expr, $d:expr) => {
#[doc=$d]
#[derive(Debug, Eq, Clone, PartialEq, Hash)]
#[allow(non_camel_case_types)]
#[repr(transparent)]
pub struct $r(pub ::std::os::raw::$r);
unsafe impl autocxx_engine::cxx::ExternType for $r {
type Id = autocxx_engine::cxx::type_id!($c);
type Kind = autocxx_engine::cxx::kind::Trivial;
}
};
}

Cheers

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions