Skip to content

Commit 2ffc55b

Browse files
committed
---
yaml --- r: 228977 b: refs/heads/try c: d2e802b h: refs/heads/master i: 228975: 67425d9 v: v3
1 parent 490a0e3 commit 2ffc55b

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: aca2057ed5fb7af3f8905b2bc01f72fa001c35c8
33
refs/heads/snap-stage3: 1af31d4974e33027a68126fa5a5a3c2c6491824f
4-
refs/heads/try: 758895718c8883376f9faff883247b8abe937bca
4+
refs/heads/try: d2e802b827d5020c89e1d3290fe13602386a4b33
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
77
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try/vec.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -863,8 +863,8 @@ method of RawVec.
863863
impl<T> RawVec<T> {
864864
fn new() -> Self {
865865
unsafe {
866-
// -1 is usize::MAX. This branch should be stripped at compile time.
867-
let cap = if mem::size_of::<T>() == 0 { -1 } else { 0 };
866+
// !0 is usize::MAX. This branch should be stripped at compile time.
867+
let cap = if mem::size_of::<T>() == 0 { !0 } else { 0 };
868868

869869
// heap::EMPTY doubles as "unallocated" and "zero-sized allocation"
870870
RawVec { ptr: Unique::new(heap::EMPTY as *mut T), cap: cap }
@@ -1036,8 +1036,8 @@ struct RawVec<T> {
10361036
impl<T> RawVec<T> {
10371037
fn new() -> Self {
10381038
unsafe {
1039-
// -1 is usize::MAX. This branch should be stripped at compile time.
1040-
let cap = if mem::size_of::<T>() == 0 { -1 } else { 0 };
1039+
// !0 is usize::MAX. This branch should be stripped at compile time.
1040+
let cap = if mem::size_of::<T>() == 0 { !0 } else { 0 };
10411041

10421042
// heap::EMPTY doubles as "unallocated" and "zero-sized allocation"
10431043
RawVec { ptr: Unique::new(heap::EMPTY as *mut T), cap: cap }

0 commit comments

Comments
 (0)