Skip to content

LLVM_ERROR with -Zmir-opt-level=3: match.rs #75507

Closed
@matthiaskrgr

Description

@matthiaskrgr

Code from ./src/test/codegen/match.rs

#![crate_type = "lib"]

pub enum E {
    A,
    B,
}

#[no_mangle]
pub fn exhaustive_match(e: E) -> u8 {
    match e {
        E::A => 0,
        E::B => 1,
    }
}

There was an LLVM ERROR with
rustc ./src/test/codegen/match.rs -Zmir-opt-level=3

Function return type does not match operand type of return inst!
  ret i1 %7
 i8in function exhaustive_match
LLVM ERROR: Broken function found, compilation aborted!

Meta

repo @ 5e3f1b1

Backtrace

Function return type does not match operand type of return inst!
  ret i1 %7
 i8in function exhaustive_match
LLVM ERROR: Broken function found, compilation aborted!

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-mir-optArea: MIR optimizationsC-bugCategory: This is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions