remove redundant explanation

pull/10/head
Alexis Beingessner 9 years ago committed by Manish Goregaokar
parent b08d4dde35
commit 986d7980c9

@ -51,22 +51,7 @@ struct IntoIter<T> {
}
```
One last subtle detail: if our Vec is empty, we want to produce an empty
iterator. This will actually technically fall out doing the naive thing of:
```text
start = ptr
end = ptr.offset(len)
```
However because `offset` is marked as a GEP inbounds instruction, this will tell
LLVM that ptr is allocated and won't alias other allocated memory. This is fine
for zero-sized types, as they can't alias anything. However if we're using
`heap::EMPTY` as a sentinel for a non-allocation for a *non-zero-sized* type,
this can cause Undefined Behaviour. Alas, we must therefore special case either
cap or len being 0 to not do the offset.
So this is what we end up with for initialization:
And this is what we end up with for initialization:
```rust,ignore
impl<T> Vec<T> {

Loading…
Cancel
Save