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

Comments

Projects
None yet
2 participants
@alexcrichton
Copy link
Member

alexcrichton commented Oct 30, 2014

Tracking issue for rust-lang/rfcs#339

Nominating for backcompat-lang

alexcrichton added a commit to alexcrichton/rust that referenced this issue Oct 31, 2014

rustc: Change byte literals to fixed-size arrays
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

bors added a commit that referenced this issue Nov 2, 2014

auto merge of #18480 : alexcrichton/rust/issue-18465, r=jakub-
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 #18465

bors added a commit that referenced this issue Nov 4, 2014

auto merge of #18480 : alexcrichton/rust/issue-18465, r=jakub-
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 #18465
@pnkfelix

This comment has been minimized.

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

Auto merge of #22838 - petrochenkov:bytelit, r=alexcrichton
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

Auto merge of #22838 - petrochenkov:bytelit, r=alexcrichton
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]

Manishearth added a commit to Manishearth/rust that referenced this issue Mar 18, 2015

Rollup merge of rust-lang#22838 - petrochenkov:bytelit, r=alexcrichton
 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 rust-lang#21725) and adds test for rust-lang#17233, which seems to be resolved.

Fixes rust-lang#18465
[breaking-change]

@bors bors closed this in #22838 Mar 18, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.