Skip to content

[i128] ICE when calling function with #[repr(C)]'d tuple struct #38763

Closed
@est31

Description

@est31

The following code causes an ICE on current master (ac5cd3b):

#![feature(i128_type)]

#[repr(C)]
struct Foo(i128);

#[link(name = "test", kind = "static")]
extern "C" {
    fn foo(f: Foo) -> Foo;
}

fn main() {
    unsafe {
        foo(Foo(1));
    }
}

ICE message:

error: internal compiler error: src/librustc_trans/cabi_x86_64.rs:321: llregtype: unhandled class

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:423
note: Run with `RUST_BACKTRACE=1` for a backtrace.

cc #35118 (tracking issue)
cc @nagisa , me

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.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