Skip to content

Commit 6d4c138

Browse files
committed
---
yaml --- r: 229036 b: refs/heads/try c: 14bc454 h: refs/heads/master v: v3
1 parent 3a58a27 commit 6d4c138

File tree

2 files changed

+2
-17
lines changed

2 files changed

+2
-17
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: 06ded9c04e23ceaa41a4a5d01dd54432aaafd0db
4+
refs/heads/try: 14bc45477085222dcf2b87bef75ca3e7d0b5274a
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
77
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try/src/doc/tarpl/vec-into-iter.md

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -51,22 +51,7 @@ struct IntoIter<T> {
5151
}
5252
```
5353

54-
One last subtle detail: if our Vec is empty, we want to produce an empty
55-
iterator. This will actually technically fall out doing the naive thing of:
56-
57-
```text
58-
start = ptr
59-
end = ptr.offset(len)
60-
```
61-
62-
However because `offset` is marked as a GEP inbounds instruction, this will tell
63-
LLVM that ptr is allocated and won't alias other allocated memory. This is fine
64-
for zero-sized types, as they can't alias anything. However if we're using
65-
`heap::EMPTY` as a sentinel for a non-allocation for a *non-zero-sized* type,
66-
this can cause Undefined Behaviour. Alas, we must therefore special case either
67-
cap or len being 0 to not do the offset.
68-
69-
So this is what we end up with for initialization:
54+
And this is what we end up with for initialization:
7055

7156
```rust,ignore
7257
impl<T> Vec<T> {

0 commit comments

Comments
 (0)