Inconsistent warning for macros that contain unexpected_cfgs
#18461
Labels
C-support
Category: support questions
unexpected_cfgs
#18461
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
.In
myapp/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 :).
The text was updated successfully, but these errors were encountered: