File tree Expand file tree Collapse file tree 2 files changed +2
-17
lines changed
branches/try/src/doc/tarpl Expand file tree Collapse file tree 2 files changed +2
-17
lines changed Original file line number Diff line number Diff line change 1
1
---
2
2
refs/heads/master: aca2057ed5fb7af3f8905b2bc01f72fa001c35c8
3
3
refs/heads/snap-stage3: 1af31d4974e33027a68126fa5a5a3c2c6491824f
4
- refs/heads/try: 06ded9c04e23ceaa41a4a5d01dd54432aaafd0db
4
+ refs/heads/try: 14bc45477085222dcf2b87bef75ca3e7d0b5274a
5
5
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
6
6
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
7
7
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
Original file line number Diff line number Diff line change @@ -51,22 +51,7 @@ struct IntoIter<T> {
51
51
}
52
52
```
53
53
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:
70
55
71
56
``` rust,ignore
72
57
impl<T> Vec<T> {
You can’t perform that action at this time.
0 commit comments