Skip to content

Commit 69511c2

Browse files
committed
auto merge of #6928 : Blei/rust/fix-constructors, r=bstrie
As part of #3853
2 parents b500307 + 1eb3a35 commit 69511c2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+197
-193
lines changed

src/compiletest/compiletest.rc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ pub fn make_test_name(config: &config, testfile: &Path) -> test::TestName {
260260

261261
pub fn make_test_closure(config: &config, testfile: &Path) -> test::TestFn {
262262
use core::cell::Cell;
263-
let config = Cell(copy *config);
264-
let testfile = Cell(testfile.to_str());
263+
let config = Cell::new(copy *config);
264+
let testfile = Cell::new(testfile.to_str());
265265
test::DynTestFn(|| { runtest::run(config.take(), testfile.take()) })
266266
}

src/libextra/arc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ mod tests {
558558
let arc = ~MutexARC(false);
559559
let arc2 = ~arc.clone();
560560
let (p,c) = comm::oneshot();
561-
let (c,p) = (Cell(c), Cell(p));
561+
let (c,p) = (Cell::new(c), Cell::new(p));
562562
do task::spawn || {
563563
// wait until parent gets in
564564
comm::recv_one(p.take());

src/libextra/flatpipes.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ mod test {
660660
#[test]
661661
#[ignore(reason = "ebml failure")]
662662
fn test_serializing_memory_stream() {
663-
let writer = BytesWriter();
663+
let writer = BytesWriter::new();
664664
let chan = serial::writer_chan(writer);
665665

666666
chan.send(10);
@@ -708,7 +708,7 @@ mod test {
708708

709709
#[test]
710710
fn test_pod_memory_stream() {
711-
let writer = BytesWriter();
711+
let writer = BytesWriter::new();
712712
let chan = pod::writer_chan(writer);
713713

714714
chan.send(10);
@@ -791,8 +791,8 @@ mod test {
791791

792792
let addr0 = ip::v4::parse_addr("127.0.0.1");
793793

794-
let begin_connect_chan = Cell(begin_connect_chan);
795-
let accept_chan = Cell(accept_chan);
794+
let begin_connect_chan = Cell::new(begin_connect_chan);
795+
let accept_chan = Cell::new(accept_chan);
796796

797797
// The server task
798798
let addr = copy addr0;

src/libextra/future.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ pub fn from_port<A:Owned>(port: PortOne<A>) -> Future<A> {
109109
* waiting for the result to be received on the port.
110110
*/
111111

112-
let port = Cell(port);
112+
let port = Cell::new(port);
113113
do from_fn {
114114
recv_one(port.take())
115115
}
@@ -137,7 +137,7 @@ pub fn spawn<A:Owned>(blk: ~fn() -> A) -> Future<A> {
137137

138138
let (port, chan) = oneshot();
139139

140-
let chan = Cell(chan);
140+
let chan = Cell::new(chan);
141141
do task::spawn {
142142
let chan = chan.take();
143143
send_one(chan, blk());
@@ -204,7 +204,7 @@ mod test {
204204
#[test]
205205
fn test_sendable_future() {
206206
let expected = "schlorf";
207-
let f = Cell(do spawn { expected });
207+
let f = Cell::new(do spawn { expected });
208208
do task::spawn {
209209
let mut f = f.take();
210210
let actual = f.get();

src/libextra/net_tcp.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1830,7 +1830,7 @@ mod test {
18301830
let (server_po, server_ch) = stream::<~str>();
18311831
let server_ch = SharedChan::new(server_ch);
18321832
let server_ip_addr = ip::v4::parse_addr(server_ip);
1833-
let resp_cell = Cell(resp);
1833+
let resp_cell = Cell::new(resp);
18341834
let listen_result = listen(server_ip_addr, server_port, 128,
18351835
iotask,
18361836
// on_establish_cb -- called when listener is set up
@@ -1842,7 +1842,7 @@ mod test {
18421842
// risky to run this on the loop, but some users
18431843
// will want the POWER
18441844
|new_conn, kill_ch| {
1845-
let resp_cell2 = Cell(resp_cell.take());
1845+
let resp_cell2 = Cell::new(resp_cell.take());
18461846
debug!("SERVER: new connection!");
18471847
let (cont_po, cont_ch) = stream();
18481848
let server_ch = server_ch.clone();

src/libextra/rc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ mod test_rc {
105105

106106
#[test]
107107
fn test_clone() {
108-
let x = rc_from_owned(Cell(5));
108+
let x = rc_from_owned(Cell::new(5));
109109
let y = x.clone();
110110
do x.borrow().with_mut_ref |inner| {
111111
*inner = 20;
@@ -115,7 +115,7 @@ mod test_rc {
115115

116116
#[test]
117117
fn test_deep_clone() {
118-
let x = rc_from_owned(Cell(5));
118+
let x = rc_from_owned(Cell::new(5));
119119
let y = x.deep_clone();
120120
do x.borrow().with_mut_ref |inner| {
121121
*inner = 20;

src/libextra/sync.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,7 @@ mod tests {
818818
let s = ~semaphore(1);
819819
let s2 = ~s.clone();
820820
let (p,c) = comm::stream();
821-
let child_data = Cell((s2, c));
821+
let child_data = Cell::new((s2, c));
822822
do s.access {
823823
let (s2, c) = child_data.take();
824824
do task::spawn || {
@@ -999,7 +999,7 @@ mod tests {
999999
let mut sibling_convos = ~[];
10001000
for 2.times {
10011001
let (p,c) = comm::stream();
1002-
let c = Cell(c);
1002+
let c = Cell::new(c);
10031003
sibling_convos.push(p);
10041004
let mi = ~m2.clone();
10051005
// spawn sibling task

src/libextra/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ pub fn run_test(force_ignore: bool,
568568
fn run_test_inner(desc: TestDesc,
569569
monitor_ch: SharedChan<MonitorMsg>,
570570
testfn: ~fn()) {
571-
let testfn_cell = ::core::cell::Cell(testfn);
571+
let testfn_cell = ::core::cell::Cell::new(testfn);
572572
do task::spawn {
573573
let mut result_future = None; // task::future_result(builder);
574574

src/libextra/timer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ mod test {
282282

283283
for (times as uint).times {
284284
let mut rng = rand::rng();
285-
let expected = Cell(rng.gen_str(16u));
285+
let expected = Cell::new(rng.gen_str(16u));
286286
let (test_po, test_ch) = stream::<~str>();
287287
let hl_loop_clone = hl_loop.clone();
288288
do task::spawn() {

src/libextra/workcache.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ impl TPrep for Prep {
347347
_ => {
348348
let (port, chan) = oneshot();
349349
let blk = replace(&mut bo, None).unwrap();
350-
let chan = Cell(chan);
350+
let chan = Cell::new(chan);
351351

352352
do task::spawn {
353353
let exe = Exec {

0 commit comments

Comments
 (0)