Skip to content

ICE if fn main() is #[no_mangle]-ed #19495

Closed
@liigo

Description

@liigo
#[no_mangle]
fn main() {
    println!("hello world");
}

when rustc hello.rs, rustc panicked:

rustc: /home/liigo/rust/rust/src/llvm/include/llvm/Support/Casting.h:237: typename llvm::cast_retty<X, Y*>::ret_type llvm::cast(Y*) [with X = llvm::Function; Y = llvm::Value; typename llvm::cast_retty<X, Y*>::ret_type = llvm::Function*]: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
[1]    4419 abort      rustc hello.rs

Metadata

Metadata

Assignees

No one assigned

    Labels

    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions