randomPoison / cs-bindgen

Experiment in using Rust to build a library that can be loaded by Unity across multiple platforms
4 stars 0 forks source link

Generate compiler errors for generics #13

Closed randomPoison closed 4 years ago

randomPoison commented 4 years ago

For the time being we can't support generating bindings for generic structs or functions. Currently the #[cs_bindgen] proc macro will generate a parsing error if it encounters generics but the error isn't very helpful. We should specifically detect the presence of generics and emit a more useful error message. We can use the trybuild crate to write tests for this behavior.

randomPoison commented 4 years ago

The code generation for impl blocks added in #15 is setup to generate errors for generic parameters. We still need to unit tests for these, but the code can be used as an example for how to do this for functions as well.