rust-analyzer
rust-analyzer copied to clipboard
Attributes like #![allow(non_camel_case_types)] not recognized in files included using `include!()` macro
rust-analyzer version: 0.4.2071-standalone [/home/nessaj/.vscode/extensions/rust-lang.rust-analyzer-0.4.2071-linux-x64/server/rust-analyzer]
rustc version: rustc 1.80.1 (3f5fd8dd4 2024-08-06)
editor or extension: VSCode 1.92.1, rust-analyzer v0.4.2071 (pre-release)
relevant settings:
repository link (if public, optional):
code snippet to reproduce:
// src/lib.rs
#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
include!("./xx.rs");
// src/xx.rs
pub type __u_char = ::std::os::raw::c_uchar;
After #17863 has been applied it seemed r-a did not recognize the following attributes correctly in lib.rs that using include!() macro:
// src/lib.rs
#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
include!("./xx.rs");
Warnings like Type alias __u_char should have CamelCase name, e.g. UChar
still popped up in included files like xx.rs ablove.