Invalid `self` import was made
Open
Nobody has claimed this yet.
bug
- Dominant language
- C++
- Stars
- 2.9k
- Forks
- 231
- Avg merge
- 19h 55m
- Merged PRs (30d)
- 67
Description
Compiled Successfully when an invalid self import was made.
-
Fixing this issue will also help gccrs to emit error code
E0431similiar to rustc. -
You can view the same on
compiler-explorer
I tried this code from E0431:
#![allow(unused)]
fn main() {
use {self}; // error: `self` import can only appear in an import list with a
// non-empty prefix
}
I expected to see this happen:
- Give error like rustc. i.e.,
error[E0431]: `self` import can only appear in an import list with a non-empty prefix
Instead, this happened:
- Compiled Successfully.
Compiler returned: 0
Meta
- What version of Rust GCC were you using, git sha dba8bc5bf8247161b6eff4f738b6479382f770f2.
- gccrs (Compiler-Explorer-Build-gcc-22f4c74767bddcb9813dca06fc6a354a67d05343-binutils-2.40) 13.0.1 20230417 (experimental)
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 by compiling the minimal Rust reproducer with gccrs and compare its result with rustc. Trace how the frontend handles use {self};; done means gccrs rejects it with error E0431 and a matching diagnostic.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, rust
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100