Skip to content

Commit a0283d5

Browse files
committed
---
yaml --- r: 90363 b: refs/heads/master c: 6113508 h: refs/heads/master i: 90361: 67f654f 90359: 64deff7 v: v3
1 parent ae3c832 commit a0283d5

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
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 89e1db3d6ce37946afd7115dfcce510261537a85
2+
refs/heads/master: 61135080554d35cca151614c93693cb524fdffe0
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a6d3e57dca68fde4effdda3e4ae2887aa535fcd6
55
refs/heads/try: b160761e35efcd1207112b3b782c06633cf441a8

trunk/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),

trunk/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)