Skip to content

No warning on unfulfilled #[expect] #18120

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

Closed
lnicola opened this issue Sep 16, 2024 · 4 comments
Closed

No warning on unfulfilled #[expect] #18120

lnicola opened this issue Sep 16, 2024 · 4 comments
Labels
A-diagnostics diagnostics / error reporting C-bug Category: bug

Comments

@lnicola
Copy link
Member

lnicola commented Sep 16, 2024

#[expect(non_snake_case)]
fn main() {
    let _foo = 0;
}

The other half of #18056.

@lnicola lnicola added A-diagnostics diagnostics / error reporting C-bug Category: bug labels Sep 16, 2024
@ChayimFriedman2
Copy link
Contributor

I deliberately did not implement this because our lint handling isn't complete (e.g. I think it is disabled in proc macros for some reason), and also we will need a way to tell whether some lint is (fully) implemented.

@ChayimFriedman2
Copy link
Contributor

This will also be quite hard to achieve: if we have an #[expect(...)] mod foo; declaration in a file, we need to check all lints in foo.rs to determine if we should warn, which means checking foo's children up to the entire crate. Since we don't want a diagnostics request to be that expensive, that means caching the diagnostics of a file, and the only way to cache between requests is in the DB. But if it's in the DB, it cannot be in crates/ide-diagnostics, and all handlers depend on IDE functionality...

@lnicola
Copy link
Member Author

lnicola commented Sep 16, 2024

Yeah, it's fine to leave this for some later time which might never come. I filed it pre-emptively because I suspect people will complain anyway.

@Veykril
Copy link
Member

Veykril commented Sep 16, 2024

Imo this is something we shouldn't even bother implementing. Any small divergence between r-a and rustc could make us emit a false diagnostic from this. "Having to" fallback to cargo for this to be checked seem absolutely fine in my eyes as this is purely a check that your allow is actually doing something.

@lnicola lnicola closed this as not planned Won't fix, can't repro, duplicate, stale Sep 16, 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

3 participants