rust-lang / rust-analyzer

A Rust compiler front-end for IDEs
https://rust-analyzer.github.io/
Apache License 2.0
13.79k stars 1.52k forks source link

RA shows unused attribute warning for all #[inline] annotations #3345

Closed Robbepop closed 3 years ago

Robbepop commented 4 years ago

I think this is a bug in RA since rustc doesn't have any problems with the same attributes. 2020-02-27-125958_1110x298_scrot

bjorn3 commented 4 years ago

According to the screenshot, the warning does come from rustc. Can you give some more context about what code gives the warning?

Robbepop commented 4 years ago

I re-checked and rustc (stable, beta and nightly) really doesn't result in warnings. However, for the projects I have checked (several) I receive those warnings that you can see. You can test that for example with one of the smaller projects. For example this is the line in the screenshot: https://github.com/Robbepop/string-interner/blob/master/src/lib.rs#L210

edwin0cheng commented 4 years ago

@Robbepop I just tested the string-interner repository you mentioned, but I can't reproduce it. (No errors or warnings). Do you enable any feature flags or something special (e.g. cargo clippy? rust version etc..) ?

[edit] My setup:

Windows 10, rustc 1.41.0 (5e1a79984 2020-01-27) rust-analyzer version : rust-analyzer 4741ae7

phil-opp commented 4 years ago

I also encountered this issue. For me, the issue occurs for https://github.com/rust-osdev/x86_64, but only when I change the "Rust-analyzer > Cargo-watch: Command" from check to clippy.

Robbepop commented 4 years ago

I also encountered this issue. For me, the issue occurs for https://github.com/rust-osdev/x86_64, but only when I change the "Rust-analyzer > Cargo-watch: Command" from check to clippy.

In my case from what I can see this setting is still check.

lnicola commented 3 years ago

@Robbepop does this still happen?

(Marking S-actionable, if you look at this in the future and the OP hasn't answered, ping me so we can close it).

Robbepop commented 3 years ago

Hard to redo the original checks since the repository I linked to has changed quite significantly. However, I cannot remember this bug having appeared so I guess we are good to close this issue. ;)