Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add #[allow(dead_code)] and #[allow(non_camel_case_types)] to the generated code #15

Open
acertain opened this issue Nov 9, 2014 · 3 comments

Comments

@acertain
Copy link

acertain commented Nov 9, 2014

Generated code produces a large amount of non_camel_case_types and dead_code warnings, it should be marked allow so that rustc doesn't complain.

@dwrensha
Copy link
Member

dwrensha commented Nov 9, 2014

I understand the issue with the dead_code warning, but I'm puzzled about the non_camel_case_types warning. Could you post a schema whose generated code produces that warning?

The general problem is this: following Cargo's recommended method for generating code, I want to be able to use the include!() macro for bringing in the generated code, like this. Unfortunately, the include!() macro currently doesn't play nice with inner attributes: rust-lang/rust#18810

dwrensha added a commit that referenced this issue Feb 17, 2018
simplify benchmark packed/none abstraction
@tv42
Copy link

tv42 commented Feb 3, 2024

I've also needed to add all of these to where I have the include!:

#![allow(dead_code)]
#![allow(unused_qualifications)]
#![allow(clippy::expl_impl_clone_on_copy)]
#![allow(clippy::must_use_candidate)]
#![allow(clippy::semicolon_if_nothing_returned)]
#![allow(clippy::uninlined_format_args)]

@tv42
Copy link

tv42 commented Feb 3, 2024

The Rust issue linked has moved to rust-lang/rfcs#752

Since capnproto-rust generates files that mostly have a pub mod ... per top-level message and pub static for consts, maybe it should just generate those allows for each top-level thing. That doesn't sound too onerous.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants