We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
std
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.
vec
rustc
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)
rustc 1.79.0 (129f3b996 2024-06-10)
editor or extension: VSCode
The text was updated successfully, but these errors were encountered:
I find that if I comment out assert_eq, then vec will correctly resolve to the local one.
assert_eq
Sorry, something went wrong.
We don't resolve macros correctly when there is shadowing happening with textual macro scopes, there is a bunch of related issues #7084 #14862
Our macro name resolution is generally not working correctly in this regard
This works now
No branches or pull requests
Take the following code as an example.
code snippet to reproduce:
RA can't understand that this local
vec
macro shadows the macro fromstd
. The code compiles fine withrustc
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
The text was updated successfully, but these errors were encountered: