Rust-GCC / Rust-GCC/gccrs

Unresolved import with external module in name resolution 2.0

Open
#2,997 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug name resolution
Dominant language
C++
Stars
2.9k
Forks
231
Avg merge
19h 55m
Merged PRs (30d)
67

Description

with the following project structure:

test/
    - lib.rs
    - foo.rs

and the following file content

// test/lib.rs
mod foo;

use foo::Foo;
// test/foo.rs
pub struct Foo;

we get the following error:

~/G/r/gccrs (master|✚1) [1] $ build/gcc/crab1 test/lib.rs -frust-name-resolution-2.0
test/lib.rs:3:10: error: unresolved import ‘foo::Foo’ [E0433]
    3 | use foo::Foo;
      |          ^~~

name resolution 1.0 and rustc do not emit any errors

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

Reproduce the issue with test/lib.rs and test/foo.rs using build/gcc/crab1 test/lib.rs -frust-name-resolution-2.0, then compare the result with name resolution 1.0 and rustc. The work is done when the 2.0 resolver accepts the external module import without reporting E0433.

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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.