Closed
Description
rust-analyzer version: 0.3.1325-standalone (9ed1829 2022-12-17)
rustc version: 1.66.0 (69f9c33d7 2022-12-12)
relevant settings: (eg. client settings, or environment variables like CARGO
, RUSTUP_HOME
or CARGO_HOME
)
A reproducible example:
Cargo.toml
:
[package]
name = "example"
version = "0.1.0"
edition = "2021"
[dependencies]
lib.rs
:
#[macro_export]
macro_rules! vec {
() => { 1 };
}
main.rs
:
use example::vec;
fn main() {
println!("{}", vec!());
}
When editing main.rs
, rust-analyzer seems to interpret vec!
in println!
as the vec!
in the standard library (hover).
The same bug happens when using macros from another crate, like the column!
in iced
, but not when the macro is defined in the same file.