Skip to content

Invalid Error Code for E0423 #2433

Open
@MahadMuhammad

Description

@MahadMuhammad

Wrong Error Code for E0423


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 866512c
  • gccrs (Compiler-Explorer-Build-gcc-a06cec181de6398231e0662c1ed83d905ad6d1d9-binutils-2.40) 13.0.1 20230417 (experimental)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions