Closed
Description
Take the following code as an example.
code snippet to reproduce:
macro_rules! vec {
($elem:expr; $n:expr) => (std::vec![::core::convert::Into::into($elem); $n]);
($($x:expr),* $(,)?) => (std::vec![$(::core::convert::Into::into($x)),* ]);
}
fn main() {
let actual: Vec<String> = vec!["foo", "bar", "baz"];
assert_eq!(actual, ["foo", "bar", "baz"]);
}
RA can't understand that this local vec
macro shadows the macro from std
. The code compiles fine with rustc
though.
Meta
rust-analyzer version: rust-analyzer version: 0.3.2037-standalone [/home/veetaha/.vscode-server/extensions/rust-lang.rust-analyzer-0.3.2037-linux-x64/server/rust-analyzer]
rustc version: rustc 1.79.0 (129f3b996 2024-06-10)
editor or extension: VSCode