Skip to content

Consider adding option for utilizing extern_types #1191

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

Open
crumblingstatue opened this issue Dec 11, 2017 · 3 comments
Open

Consider adding option for utilizing extern_types #1191

crumblingstatue opened this issue Dec 11, 2017 · 3 comments

Comments

@crumblingstatue
Copy link

The extern types RFC has been implemented for a while now, but it's not very well baked yet.

Adding an unstable option to utilize extern types for opaque types might be a nice way to get some real world use out of extern types, before they get stabilized.

This option would -of course- be only available on the nightly rust target.

@emilio
Copy link
Contributor

emilio commented Jan 22, 2018

Sorry for the huge lag here.

What do you mean with for "opaque" types? Opaque types need to maintain their layout and such, so I don't see how they map. You mean for empty types / forward declarations and such?

If so, it should be doable, I can mentor it if needed.

@crumblingstatue
Copy link
Author

By "opaque types", I was trying to refer to what are apparently called opaque pointers.

Many C libraries employ a technique where the API only forward declares a type (T), but never defines it. Then, the users interact with T by calling functions that deal with pointers to T.

I guess I could try implementing it, no promises though.

@emilio
Copy link
Contributor

emilio commented Jan 24, 2018

By "opaque types", I was trying to refer to what are apparently called opaque pointers.

Ok, yeah, that's the forward declaration I meant above :)

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

No branches or pull requests

2 participants