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

Attributes like #![allow(non_camel_case_types)] not recognized in files included using include!() macro #17874

Closed
NessajCN opened this issue Aug 13, 2024 · 1 comment
Labels
A-diagnostics diagnostics / error reporting C-bug Category: bug

Comments

@NessajCN
Copy link

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.

@NessajCN NessajCN added the C-bug Category: bug label Aug 13, 2024
@ShoyuVanilla ShoyuVanilla added the A-diagnostics diagnostics / error reporting label Aug 13, 2024
@ChayimFriedman2
Copy link
Contributor

This is fixed now, probably since #18099.

@Veykril Veykril closed this as completed Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics diagnostics / error reporting C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

4 participants