name resolution 2.0 fails on impl function call
Open
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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