Skip to content

compiler crash on stable, beta, nightly #27925

Closed
@spacejam

Description

@spacejam
struct Sched {
    i: i32,
}

impl Sched {
    extern "C" fn get(self) -> i32 { self.i }
}

fn main() {
    let s = Sched { i: 4 };
    let f = || -> i32 {
         s.get()
    };
    println!("f: {}", f());
}

stable/beta:

Stored value type does not match pointer operand type!
  store { i64 } %0, i32* %1, align 4
 i32LLVM ERROR: Broken function found, compilation aborted!

nightly:

rustc: /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/llvm/lib/IR/Instructions.cpp:995: void llvm::StoreInst::AssertOK(): Assertion `getOperand(0)->getType() == cast<PointerType>(getOperand(1)->getType())->getElementType() && "Ptr must be a pointer to Val type!"' failed.
Aborted (core dumped)

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