Skip to content

indexing into a constant repeat expression yields repeat value #33252

Closed
@oli-obk

Description

@oli-obk

The following piece of code errors with expected usize value for array length, got repeat. Seems like I ended up forwarding the wrong expression during the computation of a const repeat.

#![feature(const_indexing)]

const X: [usize; 5] = [5; 5];

fn main() {
    let _: [i32; X[0]];
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions