Type `off_t` should have an upper camel case name

I'm working on a wrapper library, where the C++ API makes heavy use of types like int32, off_t, etc. The compiler, and #[allow(non_camel_case_types)] doesn't seem to help a bit.

Is there some allow value I missed that would suppress this warning? I hate to be the type who just gets used to the predictable deluge of 110 errors, but this is the API, both at the C level and bindgen output.

Also, bindgen generates things like pub const some_type_SOME_VALUE1: some_type = 2;, where rustc complains about lower case in a const. Any way to suppress this?

#[allow(non_camel_case_types)] should work.

#[allow(non_upper_case_globals)]. There's also a lint group, #[allow(nonstandard_style)].

You can apply these to more than one item...

// Top of module, the `!` means to apply it to everything within
#![allow(nonstandard_style)]

...but I only recommend doing that if all the generated/compatibility names are in their own module, so that your Rust code stays more idiomatic.

2 Likes