Skip to content

Commit acf08a0

Browse files
committed
---
yaml --- r: 94198 b: refs/heads/try c: 6113508 h: refs/heads/master v: v3
1 parent 3356869 commit acf08a0

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
@@ -2,7 +2,7 @@
22
refs/heads/master: 0da105a8b7b6b1e0568e8ff20f6ff4b13cc7ecc2
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a6d3e57dca68fde4effdda3e4ae2887aa535fcd6
5-
refs/heads/try: 89e1db3d6ce37946afd7115dfcce510261537a85
5+
refs/heads/try: 61135080554d35cca151614c93693cb524fdffe0
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/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/try/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)