Skip to content

Unreachable generic array concat breaks trans #1901

@jruderman

Description

@jruderman

Testcase 1:

fn f<T: copy>(a: T) {
    fail + [a]
}
fn main() {}

Testcase 2:

fn f<T>(g: fn() -> [T]) {
    let r = fail;
    r += g();
}
fn main() {}

Both trigger:

Assertion failed: (isa<X>(Val) && "cast<Ty>() argument of incompatible type!"), function cast, file /Users/jruderman/code/rust/src/llvm/include/llvm/Support/Casting.h, line 194.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-codegenArea: Code generation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions