-
Notifications
You must be signed in to change notification settings - Fork 365
Allow type aliases to be marked as Trivial. #325
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
56b4228
to
95c5758
Compare
This change allows aliases: type Foo = bindgen::Bar; and C++ opaque types: type Foo; to declare that they're 'trivial' in the sense that: * They have trivial move constructors * They have no destructors and therefore may be passed and owned by value in Rust. A subsequent commit will add C++ static assertions. This commit is a BREAKING CHANGE as it requires existing ExternTypes to gain a new associated type
95c5758
to
d7f5bb9
Compare
I've just read #308 and it looks like I should rebase on top of that, if you think it will land soon, as there's a lot of commonality. I also need to add some tests like that PR has done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, this is terrific.
I am going to follow up with some minor fixups (which I'll link here) but this is nicely done.
Fixes #313.
This is a breaking change as it requires all implementers of
ExternType
to add another associated type. Defaults for associated types are an unstable feature, the compiler tells me. Perhaps we should avoid this by using a new trait,ExternTypeKind
, instead.