Skip to content

Binary string literals are of type &[u8] instead of &[u8, ..n] #17626

Closed
@ftxqxd

Description

@ftxqxd

Intuitively, I would expect b"abc" to behave identically to &[97, 98, 99], but it does not: b"abc" is of type &[u8] instead of &[u8, ..3] like &[97, 98, 99] is. Changing this to &[u8, ..n] would provide more flexibility, as &[u8, ..n] can always be converted to &[u8], but not vice-versa.

Presumably this was either intentional or simply forgotten during the slice-related DST changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions