Invalid Error Code for E0423
Open
Nobody has claimed this yet.
bug
- Dominant language
- C++
- Stars
- 2.9k
- Forks
- 231
- Avg merge
- 19h 55m
- Merged PRs (30d)
- 67
Description
Wrong Error Code for E0423
- Fixing this issue help this https://github.com/Rust-GCC/gccrs/pull/2432 to emit error code similiar to rustc.
I tried this code from E0423:
// https://doc.rust-lang.org/error_codes/E0423.html
#![allow(unused)]
fn main() {
pub mod a {
pub const I: i32 = 1;
}
fn h1() -> i32 {
a.I
//~^ ERROR expected value, found module `a`
// did you mean `a::I`?
}
}
I expected to see this happen:
- Give error code similiar to rustc i.e.,
error[E0423]: expected value, found module `a`
Instead, this happened:
- It gives different error code.
E0425
➜ gccrs-build gcc/crab1 ../mahad-testsuite/E0423.rs
../mahad-testsuite/E0423.rs:8:5: error: cannot find value ‘a’ in this scope [E0425]
8 | a.I
| ^
Analyzing compilation unit
Time variable usr sys wall GGC
TOTAL : 0.00 0.00 0.00 146k
Extra diagnostic checks enabled; compiler may run slowly.
Configure with --enable-checking=release to disable checks.
Meta
- What version of Rust GCC were you using, git sha 866512cbc09bc883ef844b2b6cb70a72335756a7
- gccrs (Compiler-Explorer-Build-gcc-a06cec181de6398231e0662c1ed83d905ad6d1d9-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 reproducing the supplied E0423.rs example with the referenced gccrs revision and compare its diagnostic with rustc's E0423 output. Trace the compiler's name-resolution and error-code selection for a.I; done means this case reports E0423 rather than E0425, with the expected diagnostic wording.
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
- 42/100