Rust-GCC / Rust-GCC/gccrs

name resolution 2.0 fails on impl function call

Open
#3,000 0 comments 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

I tried this code:

struct Foo;

impl Foo {
    fn new() -> Foo {
        Foo
    }
}

fn main() {
    let _ = Foo::new();
}

I expected to see this happen: no error.

Instead, this happened:

~/G/r/gccrs (master|✚2) $ build/gcc/crab1 test.rs -frust-name-resolution-2.0
test.rs:25:13: error: failed to resolve path segment ‘Foo’ [E0433]
   25 |     let _ = Foo::new();
      |             ^~~
Meta
  • What version of Rust GCC were you using: 8a7256676e5

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 with the Rust snippet in the issue and reproduce it using build/gcc/crab1 test.rs -frust-name-resolution-2.0. Investigate the name-resolution path handling Foo::new() and verify the command completes without the E0433 error.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, 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.