]> git.lizzy.rs Git - rust.git/commitdiff
auto merge of #13468 : alexcrichton/rust/issue-13467, r=thestinger
authorbors <bors@rust-lang.org>
Sun, 13 Apr 2014 11:06:53 +0000 (04:06 -0700)
committerbors <bors@rust-lang.org>
Sun, 13 Apr 2014 11:06:53 +0000 (04:06 -0700)
Previously, all slices derived from a vector whose values were of size 0 had a
null pointer as the 'data' pointer on the slice. This caused first pointer to be
yielded during iteration to always be the null pointer. Due to the null pointer
optimization, this meant that the first return value was None, instead of
Some(&T).

This commit changes slice construction from a Vec instance to use a base pointer
of 1 if the values have zero size. This means that the iterator will never
return null, and the iteration will proceed appropriately.

Closes #13467


Trivial merge