Skip to content

Commit c6beefa

Browse files
committed
---
yaml --- r: 96610 b: refs/heads/dist-snap c: 6113508 h: refs/heads/master v: v3
1 parent 3eb9f42 commit c6beefa

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: c274a6888410ce3e357e014568b43310ed787d36
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: 89e1db3d6ce37946afd7115dfcce510261537a85
9+
refs/heads/dist-snap: 61135080554d35cca151614c93693cb524fdffe0
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/libstd/rt/deque.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,9 @@ impl<T: Send> BufferPool<T> {
163163

164164
fn free(&mut self, buf: ~Buffer<T>) {
165165
unsafe {
166-
use cell::Cell;
167-
let buf = Cell::new(buf);
166+
let mut buf = Some(buf);
168167
self.pool.with(|pool| {
169-
let buf = buf.take();
168+
let buf = buf.take_unwrap();
170169
match pool.iter().position(|v| v.size() > buf.size()) {
171170
Some(i) => pool.insert(i, buf),
172171
None => pool.push(buf),

branches/dist-snap/src/libstd/rt/task.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ use prelude::*;
1919

2020
use borrow;
2121
use cast::transmute;
22-
use cell::Cell;
2322
use cleanup;
2423
use libc::{c_void, uintptr_t, c_char, size_t};
2524
use local_data;
@@ -427,7 +426,6 @@ impl Coroutine {
427426
}
428427

429428
fn build_start_wrapper(start: proc()) -> proc() {
430-
let start_cell = Cell::new(start);
431429
let wrapper: proc() = proc() {
432430
// First code after swap to this new context. Run our
433431
// cleanup job.
@@ -446,6 +444,7 @@ impl Coroutine {
446444
// need to unsafe_borrow.
447445
let task: *mut Task = Local::unsafe_borrow();
448446

447+
let mut start_cell = Some(start);
449448
(*task).run(|| {
450449
// N.B. Removing `start` from the start wrapper
451450
// closure by emptying a cell is critical for
@@ -457,7 +456,7 @@ impl Coroutine {
457456
// be in task context. By moving `start` out of
458457
// the closure, all the user code goes our of
459458
// scope while the task is still running.
460-
let start = start_cell.take();
459+
let start = start_cell.take_unwrap();
461460
start();
462461
});
463462
}

0 commit comments

Comments
 (0)