Skip to content

ICE - cannot mix bin crate type with others - [E0601] #2512

@MahadMuhammad

Description

@MahadMuhammad

main not found in crate - E0601


Code

fn foo() {}

// no main function

Expected to see this happen:

  • Give error when using --crate-type=bin flag.
error[E0601]: `main` function not found in crate `example`

Instead this happen:

  • It complies successfully with warning.
<source>:1:4: warning: function is never used: 'foo'
    1 | fn foo() {}
      |    ^~~
Compiler returned: 0

Meta

  • What version of Rust GCC were you using, git sha 95dcbb2
  • gccrs (Compiler-Explorer-Build-gcc-dba8bc5bf8247161b6eff4f738b6479382f770f2-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