Sean1708 / rusty-cheddar

A Rust crate for automatically generating C header files from Rust source file.
http://sean1708.github.io/rusty-cheddar/
191 stars 25 forks source link

Have a way to selectively convert `pub type A = B;`. #16

Open Sean1708 opened 8 years ago

Sean1708 commented 8 years ago

As it stands any typedefs of that form which are not generic will be put into the header, this should cover most use cases but it's not impossible for people to do something like

pub type MyResult = Result<String, ()>;

which would put

typedef Result<String, ()> MyResult;

into the header file.

The two obvious ways to combat this are using #[repr(C)] (which rustc seems to be fine with) or adding a lint group and using #[allow(cheddar_typedef)] (I'm not sure whether this would actually work).