-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
A-macromacro expansionmacro expansionA-nameresname, path and module resolutionname, path and module resolutionC-bugCategory: bugCategory: bugS-actionableSomeone could pick this issue up and work on it right nowSomeone could pick this issue up and work on it right now
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.
NMertsch and Rainb0wCodes
Metadata
Metadata
Assignees
Labels
A-macromacro expansionmacro expansionA-nameresname, path and module resolutionname, path and module resolutionC-bugCategory: bugCategory: bugS-actionableSomeone could pick this issue up and work on it right nowSomeone could pick this issue up and work on it right now