Skip to content

Commit e50b67a

Browse files
committed
---
yaml --- r: 234040 b: refs/heads/beta c: c08deef h: refs/heads/master v: v3
1 parent 387989f commit e50b67a

File tree

4 files changed

+18
-13
lines changed

4 files changed

+18
-13
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: f84d53ca0afaeac14903d16ab24455f6170795e1
26+
refs/heads/beta: c08deef9825c62ad8eb4012826b66daca30a731b
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: 370fe2786109360f7c35b8ba552b83b773dd71d6
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/src/doc/nomicon/vec-drain.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,14 +129,16 @@ impl<'a, T> Drop for Drain<'a, T> {
129129
130130
impl<T> Vec<T> {
131131
pub fn drain(&mut self) -> Drain<T> {
132-
// this is a mem::forget safety thing. If Drain is forgotten, we just
133-
// leak the whole Vec's contents. Also we need to do this eventually
134-
// anyway, so why not do it now?
135-
self.len = 0;
136-
137132
unsafe {
133+
let iter = RawValIter::new(&self);
134+
135+
// this is a mem::forget safety thing. If this is forgotten, we just
136+
// leak the whole Vec's contents. Also we need to do this *eventually*
137+
// anyway, so why not do it now?
138+
self.len = 0;
139+
138140
Drain {
139-
iter: RawValIter::new(&self),
141+
iter: iter,
140142
vec: PhantomData,
141143
}
142144
}

branches/beta/src/doc/nomicon/vec-final.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,13 +155,16 @@ impl<T> Vec<T> {
155155
}
156156

157157
pub fn drain(&mut self) -> Drain<T> {
158-
// this is a mem::forget safety thing. If this is forgotten, we just
159-
// leak the whole Vec's contents. Also we need to do this *eventually*
160-
// anyway, so why not do it now?
161-
self.len = 0;
162158
unsafe {
159+
let iter = RawValIter::new(&self);
160+
161+
// this is a mem::forget safety thing. If this is forgotten, we just
162+
// leak the whole Vec's contents. Also we need to do this *eventually*
163+
// anyway, so why not do it now?
164+
self.len = 0;
165+
163166
Drain {
164-
iter: RawValIter::new(&self),
167+
iter: iter,
165168
vec: PhantomData,
166169
}
167170
}

branches/beta/src/doc/trpl/macros.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ fn main() {
313313
}
314314
```
315315

316-
This works because Rust has a [hygienic macro system][https://en.wikipedia.org/wiki/Hygienic_macro]. Each macro expansion
316+
This works because Rust has a [hygienic macro system][]. Each macro expansion
317317
happens in a distinct ‘syntax context’, and each variable is tagged with the
318318
syntax context where it was introduced. It’s as though the variable `state`
319319
inside `main` is painted a different "color" from the variable `state` inside

0 commit comments

Comments
 (0)