E0603 on a registry dependency that re-exports a proc macro under a private module's name

Open
#268 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
rust
Domain
compilers

Research direction

Start at libs/relax/front/src/program/privacy.rs:68, where the visibility check already has the macro case, and follow it into lookup_macro_in_container (libs/relax/front/src/program.rs:5322), which reads only mods[d.sub].macros; that map is filled for exported macro_rules! at libs/relax/front/src/program.rs:3444 but apparently not for pub use-re-exported proc macros. Build the repro crate from the issue and run relax check on it, then compare with the path-dependency control, which works, to find where the registry seeding path drops the re-export. Done means the repro checks cleanly and existing macro-resolution tests still pass.

Written by the indexing model from the issue text.

Description

On Relax 953d174a (macOS arm64), relax check rejects a use of a re-exported proc macro when the exporting crate also has a private module of that name. rustc accepts it.

Reproduce

Cargo.toml

[package]
name = "repro-e0603"
version = "0.1.0"
edition = "2024"

[workspace]

[dependencies]
rutis = "0.23.0"

src/main.rs

use rutis::service;

fn main() {}
cargo generate-lockfile        # relax requires a lockfile
relax check repro-e0603

Expected: no error (rustc 1.100 reports only unused_imports).

Actual:

src/main.rs:1:1: E0603: module `service` is private

rutis 0.23.0 has both a private module and a public re-export of the attribute macro under the same name:

  • src/lib.rs:60: mod service;
  • src/lib.rs:81: pub use rutis_macros::service;

Where it points

libs/relax/front/src/program/privacy.rs:68 already has a case for exactly this:

let mut visible = last && in_use && last_ns.is_none() && self.lookup_macro_in_container(cur, name);

lookup_macro_in_container (libs/relax/front/src/program.rs:5322) only checks mods[d.sub].macros. That map is filled for exported macro_rules! at libs/relax/front/src/program.rs:3444, but a pub use-re-exported proc macro is not registered there, so the private mod service wins.

Control

The same shape as a path dependency does not reproduce: a local crate with mod service; + pub use local_macro::service;, imported as use local_crate::service;, checks cleanly. So the missing binding looks specific to registry crates (the seeding/demand path), not to use resolution in general.

Dominant language
Rust
Stars
601
Forks
34
Avg merge
1h 58m
Merged PRs (30d)
45

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

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.

More from makepad/relax

All issues in makepad/relax

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.