rust-bindgen icon indicating copy to clipboard operation
rust-bindgen copied to clipboard

Have some easy way to #[allow(non_camel_case_types)] (or even do it by default)

Open HadrienG2 opened this issue 1 year ago • 1 comments

C and C++ commonly use snake_case type names, so the non_camel_case_types default rustc lint generates a lot of noise in bindgen-originated modules. There should at least be an easy way to disable this lint in bindgen's output, and imo it should be turned off by default.

HadrienG2 avatar Feb 12 '24 08:02 HadrienG2

After closer investigation, --raw-line can be used to inhibit the lint quite easily, so the only remaining question is, should bindgen make it the default.

HadrienG2 avatar Feb 12 '24 09:02 HadrienG2

Even though having it as a default sounds like an attractive proposition, it would require to have an option to opt out from this behavior as bindgen's API is pretty large already.

This also opens the door to have other attributes injected by default and, as a consequence, more options to not inject those attributes.

pvdrz avatar Apr 03 '24 16:04 pvdrz

Yeah I think raw-line is more flexible and already a thing.

emilio avatar Apr 03 '24 16:04 emilio