Skip to content

ICE when #[no_mangle] function is declared multiple times with different signatures. #18358

Closed
@mahkoh

Description

@mahkoh
#![allow(dead_code)]

mod x {
    #[no_mangle]
    fn f() { }
}

mod y {
    #[no_mangle]
    fn f(_: i32) { }
}

fn main() { }

rustc: /build/rust-git/src/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(Val) && "cast() argument of incompatible type!"' failed.

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