Skip to content

ICE when passing large fixed-size array as T:Clone via T:Copy #25733

Closed
@pnkfelix

Description

@pnkfelix

Spawned off of #24000

fn main() {
    let x = [5; 100];
    foo(x);
}

fn foo<X: Copy>(x: X) { let _ = bar(x); }

fn bar<X:Clone>(x: X) { let _ = x.clone(); }

causes this ICE:

<anon>:8:33: 8:42 error: internal compiler error: Encountered error `Unimplemented` selecting `Binder(core::clone::Clone)` during trans
<anon>:8 fn bar<X:Clone>(x: X) { let _ = x.clone(); }
                                         ^~~~~~~~~
note: the compiler unexpectedly panicked. this is a bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.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