Closed funemy closed 3 weeks ago
Is the same thing happening with cargo check
?
@ChayimFriedman2 I'm not sure if I did it correctly, but I didn't see any warning with cargo check
.
Then rust-analyzer is functioning correctly, the warnings are reported by Cargo (and rustc), if they are missing it's at most a Cargo bug, not a rust-analyzer bug.
I believe this is because there is no way to state the expected features for a binary, so every feature is expected.
Hi, I recently encountered an inconsistent behavior of rust-analyzer when I have a macro which expands to something with
unexpected_cfgs
.I would like to understand if this is expected, because it feels like a bug to me.
Here is a minimal example:
Say I have a library
mylib
, andmylib/lib.rs
hasmylib
has no feature declared, so I got anunexpected_cfgs
warning in the place where I calledmy_lib_macro!()
:This is great, exactly what I would expect.
However, if I use
mylib
in other packages, say I have another crate,myapp
, that depends onmylib
. Inmyapp/main.rs
, I have:Rust-analyzer does not report anything in
main()
, which confuses me why that is the case.Hopefully the example makes sense, happy to provide more information if needed. And thanks for the help :).