"How can I test compile fail/pass..." <- I've built myself some testing framework for device-driver. I can build a case: https://github.com/diondokter/device-driver/tree/kdl-input/tests/cases/device_definition_errors Every case gets picked up by a build.rs. A test fn is generated and included in the test project. That way you can just run `cargo test`. Every case has an input, this is run using the tool to get the diagnostics and Rust output. The outputs are then compared with the known outputs it should produce. If that's all ok, the Rust is compiled to check for compile errors. (They're actually cargo scripts in these test cases!)