Skip to content

Hard-wired index operator for vectors implicitly converts integral types #10453

Closed
@brendanzab

Description

@brendanzab

This is legal at the moment:

assert_eq!([1, 2, 3][1i8], 2);
assert_eq!([1, 2, 3][1u8], 2);

Shouldn't we only allow uints here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions