Skip to content
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

Check our usage of repr(C) vs. repr(transparent) #444

Closed
madsmtm opened this issue Apr 29, 2023 · 3 comments
Closed

Check our usage of repr(C) vs. repr(transparent) #444

madsmtm opened this issue Apr 29, 2023 · 3 comments
Labels
A-block2 Affects the `block2` crate A-framework Affects the framework crates and the translator for them A-objc2 Affects the `objc2`, `objc2-exception-helper` and/or `objc2-encode` crates
Milestone

Comments

@madsmtm
Copy link
Owner

madsmtm commented Apr 29, 2023

They are slightly different, as noted in the RFC introducing the latter

@madsmtm madsmtm added this to the icrate v0.1.0 milestone May 26, 2023
@madsmtm madsmtm added A-objc2 Affects the `objc2`, `objc2-exception-helper` and/or `objc2-encode` crates A-framework Affects the framework crates and the translator for them A-block2 Affects the `block2` crate labels Sep 1, 2023
@madsmtm
Copy link
Owner Author

madsmtm commented Sep 1, 2023

I've verified that we don't use #[repr(C)] on any structs like this.

In general, ideally we'd use #[repr(transparent)] whenever possible, since it plays better with extern types once we get those, but the improper_ctypes lint doesn't work that well with it, so I'll keep #[repr(C)] for now.

@madsmtm madsmtm closed this as completed Sep 1, 2023
@silvanshade
Copy link
Contributor

but the improper_ctypes lint doesn't work that well with it

I wonder if there is an issue upstream about this. Maybe worth creating one if not.

@madsmtm
Copy link
Owner Author

madsmtm commented Sep 1, 2023

Good idea, I've opened rust-lang/rust#115457 for that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-block2 Affects the `block2` crate A-framework Affects the framework crates and the translator for them A-objc2 Affects the `objc2`, `objc2-exception-helper` and/or `objc2-encode` crates
Projects
None yet
Development

No branches or pull requests

2 participants