rust-analyzer bug in modules
Check for existing issues
- [X] Completed
Describe the bug / provide steps to reproduce it
I'm quite new to Rust so bare with me.
When using a lib.rs and declaring a public module inside lib.rs, I have a few macros. For example:
#[macro_export] macro_rules! info { ($($arg:tt)*) => {{ $crate::logger::log($crate::logger::LogLevel::Info, format!($($arg)*)); }}; }
The log function and macros lives inside the same module.
However, the macro info! is calling the log function but if the log function is not using the 'pub' keyword, the rust-analyzer complains about "dead code" so it wont compile. See screenshot. If I add the 'pub' keyword, it's fine.
Is this expected behaviour or just me being a newb?
Environment
M1 - Sonoma 14.2
If applicable, add mockups / screenshots to help explain present your vision of the feature
With 'pub' keyword:
No 'pub' keyword:
If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.
If you only need the most recent lines, you can run the zed: open log command palette action to see the last 1000.
No response
Are you saying that this is a Zed issue or is it a rust-analyzer issue? If it's the latter, I think an issue opened in the rust-analyzer repository might make more sense :)
This doesn't seem like a Zed issue.