Skip to content

LLVM assertion failure with pattern matching and references #4653

Closed
@alexcrichton

Description

@alexcrichton

This program:

fn main() {
  let &(ref x, _) = &(1, 1);
}

Produces the output:

$ rustc --test bug3.rs
bug3.rs:2:8: 2:14 warning: unused variable: `x`
bug3.rs:2   let &(ref x, _) = &(1, 1);
                  ^~~~~~
Assertion failed: (getOperand(0)->getType() == cast<PointerType>(getOperand(1)->getType())->getElementType() && "Ptr must be a pointer
 to Val type!"), function AssertOK, file /Users/alex/code/rust2/src/llvm/lib/VMCore/Instructions.cpp, line 1062.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-codegenArea: Code generationI-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