rust-analyzer
rust-analyzer copied to clipboard
incorrect-ident-case triggers on traits inside functions even when #[allow()]ed
As I understand it, this is an issue where our AST doesn't properly resolve parent items of functions inside traits inside functions.
This is a known but currently (as far as i know) untracked bug, and I wrote a test for it here last time I was working on this diagnostic: https://github.com/rust-analyzer/rust-analyzer/blob/1f1a1ce4f57076be38d18f0a6defddb9c690bb1c/crates/hir_ty/src/diagnostics/decl_check.rs#L959
There's some discussion of this in #8432 also.
The practical effect of this bug is that there are spurious diagnostics thrown by RA from the bitflags crate that emits these constructs from its macro that should actually be disabled.
~cause is #8911 possibly
#8911 is now fixed.
Before that, the test was moved and behavior changed:
https://github.com/rust-analyzer/rust-analyzer/blob/393cbd0982707a20b0ef40277385737f8de1833e/crates/ide_diagnostics/src/handlers/incorrect_case.rs#L343-L366
It seems like incorrect case warnings are also triggered inside #[automatically_derived]
. See https://github.com/madonoharu/tsify/issues/42