capnproto / capnpc-rust

Cap'n Proto code generation for Rust
76 stars 26 forks source link

Add #![allow(dead_code)] in generated *.rs files #34

Closed hicqu closed 7 years ago

hicqu commented 7 years ago

There are a lot of method is never used: Something when cargo build.

So, I think we need #![allow(dead_code)]. What do you think?

dwrensha commented 7 years ago

Unfortunately, putting #![allow(dead_code)] at the top of generated files would interfere with include!(): https://github.com/rust-lang/rust/issues/18810

We could put #[allow(dead_code)] on every generated item, but that seems ugly.

So, I recommend that you add the #[allow(dead_code)] attribute yourself, at the location in the code where you include!() the generated code.

hicqu commented 7 years ago

OK, I will try do that in build.rs. Thank you!