Skip to content

LLVM ERROR: Stored value type does not match pointer operand type! #25746

@mitaa

Description

@mitaa
use std::mem;

fn main() {
    let _: i8 = unsafe { mem::transmute(true) };
    //Stored value type does not match pointer operand type!
    //  store i1 true, i8* %0
    // i8LLVM ERROR: Broken function found, compilation aborted!
    //playpen: application terminated with error code 1
}

These variations compile:

use std::mem;

fn main() {
    let _: bool = unsafe { mem::transmute(1u8) };
    let _: i8 = unsafe { mem::transmute(false) };
    let _: bool = unsafe { mem::transmute(0u8) };
}

Meta

rustc --version --verbose: current Playpen Stable+Release

Metadata

Metadata

Assignees

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