Skip to content

main entry missing if crate_type = "bin" and "lib" is both given #13337

Closed
@klutzy

Description

@klutzy
#![crate_type = "lib"]
#![crate_type = "bin"]

fn main() {
    println!("hello world");
}
error: linking with `cc` failed: exit code: 1
...
note: /usr/lib/gcc/i486-linux-gnu/4.7/../../../i386-linux-gnu/crt1.o: In function `_start':
(.text+0x18): undefined reference to `main'
collect2: error: ld returned 1 exit status

Reproduced on linux32 and win32.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions