rust-lang / rust-lang/rust-analyzer

proc-macro names and namerefs are treated inconistently

Open
#11,528 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-ide A-macro C-bug
Dominant language
Rust
Stars
16.9k
Forks
2.2k
Avg merge
1d 12h
Merged PRs (30d)
72

Description

use proc_test::{attr, Derive, proc_macro};

Here we resolve the attr and proc_macro name-ref as functions(should be attribute and macro respectively), Derive as a derive.

This seems to be caused by overlapping namespaces again, BUT the proc-macro functions shouldn't be visible from here in the first place, but our current path resolution ignores visibility.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the proc_test import snippet and inspect rust-analyzer's path resolution for proc-macro names, especially visibility and overlapping namespaces. Done means attr resolves as an attribute, proc_macro as a macro, and Derive as a derive without exposing proc-macro functions from this context.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.