Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Byte string literals should have a type of a fixed size #18465

Closed
alexcrichton opened this issue Oct 30, 2014 · 1 comment · Fixed by #22838
Closed

Byte string literals should have a type of a fixed size #18465

alexcrichton opened this issue Oct 30, 2014 · 1 comment · Fixed by #22838
Labels
B-RFC-approved Blocker: Approved by a merged RFC but not yet implemented.

Comments

@alexcrichton
Copy link
Member

Tracking issue for rust-lang/rfcs#339

Nominating for backcompat-lang

@alexcrichton alexcrichton added I-nominated B-RFC-approved Blocker: Approved by a merged RFC but not yet implemented. labels Oct 30, 2014
alexcrichton added a commit to alexcrichton/rust that referenced this issue Oct 31, 2014
This commit alters the type of `b"foo"` from `&'static [u8]` to
`&'static [u8, ..3]` and is an implementation of RFC 339.

This is a breaking change because not all operations are always compatible with
fixed-size arrays currently when compared with slices. As seen in the diff, if a
fixed-size array is the left hand size of an equality then the operator may not
resolve. Breakage may require some shuffling or explicitly converting to a slice
via `.as_slice()` or `[]`.

[breaking-change]
Closes rust-lang#18465
@pnkfelix
Copy link
Member

pnkfelix commented Nov 6, 2014

P-backcompat-lang, but not 1.0 (thus if we don't get something for it before 1.0, we probably will not adopt it at all).

bors added a commit that referenced this issue Mar 17, 2015
This patch changes the type of byte string literals from `&[u8]` to `&[u8; N]`.
It also implements some necessary traits (`IntoBytes`, `Seek`, `Read`, `BufRead`) for fixed-size arrays (also related to #21725) and adds test for #17233, which seems to be resolved.

Fixes #18465
[breaking-change]
bors added a commit that referenced this issue Mar 18, 2015
This patch changes the type of byte string literals from `&[u8]` to `&[u8; N]`.
It also implements some necessary traits (`IntoBytes`, `Seek`, `Read`, `BufRead`) for fixed-size arrays (also related to #21725) and adds test for #17233, which seems to be resolved.

Fixes #18465
[breaking-change]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B-RFC-approved Blocker: Approved by a merged RFC but not yet implemented.
Projects
None yet
2 participants