kyren / gc-arena

Incremental garbage collection from safe Rust
Creative Commons Zero v1.0 Universal
438 stars 36 forks source link

Use `trybuild` to test errors generated by gc-arena-derive #5

Closed Aaron1011 closed 3 years ago

Aaron1011 commented 3 years ago

The soundness of the code generated by gc-arena-derive relies on certain things not compiling. Currently, this is not testing, making it possible to accidentally introduce unsoundess.

This commit uses the trybuild crate to add compile-fail tests. To start out, I've added a single test that verifies that #[collect(no_drop)] causes a compilation error if a Drop impl is present.