diff options
| author | Alexis Beingessner <a.beingessner@gmail.com> | 2015-07-20 15:36:50 -0700 |
|---|---|---|
| committer | Alexis Beingessner <a.beingessner@gmail.com> | 2015-07-20 15:36:50 -0700 |
| commit | 14bc45477085222dcf2b87bef75ca3e7d0b5274a (patch) | |
| tree | 4c98e9f7aa899ae906116e6011ae9217f6af7320 | |
| parent | 06ded9c04e23ceaa41a4a5d01dd54432aaafd0db (diff) | |
| download | rust-14bc45477085222dcf2b87bef75ca3e7d0b5274a.tar.gz rust-14bc45477085222dcf2b87bef75ca3e7d0b5274a.zip | |
remove redundant explanation
| -rw-r--r-- | src/doc/tarpl/vec-into-iter.md | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/src/doc/tarpl/vec-into-iter.md b/src/doc/tarpl/vec-into-iter.md index 0ffc23c4523..a9c1917feb9 100644 --- a/src/doc/tarpl/vec-into-iter.md +++ b/src/doc/tarpl/vec-into-iter.md @@ -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> { |
