Skip to content

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

Closed

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!

Activity

  1. matthiaskrgr commented on Aug 13, 2020

    @matthiaskrgr
    MemberAuthor

    Probably related to #75382

  2. JulianKnodt commented on Aug 15, 2020

    @JulianKnodt
    Contributor

    Should be fixed by #75537

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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