Skip to content

Fixed length array type with high un-suffixed count literal incorrectly treated as negative count #15919

Closed
@lilyball

Description

@lilyball

A fixed-length array expression with a repeat count with the high bit set and no suffix is incorrectly treated as a negative count.

On a 64-bit machine:

fn main() {
    let x = [0u, ..9223372036854775808];
}

This results in

unnamed.rs:2:20: 2:39 error: expected positive integer for repeat count but found negative integer
unnamed.rs:2     let x = [0u, ..9223372036854775808];
                                ^~~~~~~~~~~~~~~~~~~
error: aborting due to previous error

Metadata

Metadata

Assignees

No one assigned

    Labels

    E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions