Skip to content

ICE: assertion failure in LLVM when returning a struct from "extern" function. #21454

Closed
@vadimcn

Description

@vadimcn

Repro:

#[repr(C)]
pub struct Foo(u32);

pub extern fn bar() -> Foo {
    Foo(0)
}

fn main() {}

ICE:

File: C:/rust/src/llvm/lib/IR/Instructions.cpp, Line 1086

Expression: getOperand(0)->getType() == cast<PointerType>(getOperand(1)->getType())->getElementType() && "Ptr must be a pointer to Val type!"

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-codegenArea: Code generationI-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