Skip to content

Attempting to match a string constant crashes the compiler #8315

Closed
@MicahChalmer

Description

@MicahChalmer

Attempting to compile this code:

static HELLO:&'static str = "Hello";

fn main() {
    println(match "Hello" {
            HELLO => "hi",
            _ => "bye"
        });
}

will make the compiler abort after outputting this:

rust: /build/buildd/rust-nightly-201308040649~93432a2~raring/src/llvm/lib/IR/Instructions.cpp:281: void llvm::CallInst::init(llvm::Value*, llvm::ArrayRef<llvm::Value*>, const llvm::Twine&): Assertion `(i >= FTy->getNumParams() || FTy->getParamType(i) == Args[i]->getType()) && "Calling a function with a bad signature!"' failed.

This was on a nightly build of rust pulled from the Ubuntu PPA. I tried it with rust 0.7 (also from the ubuntu PPA) and got the same problem.

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