From e095889e4edaa37ad78faa6394d0ac1d3650d64d Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Mon, 30 Dec 2013 17:46:48 -0800 Subject: libstd: De-`@mut` the `heap_cycles` test --- src/libstd/rt/task.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/libstd/rt') diff --git a/src/libstd/rt/task.rs b/src/libstd/rt/task.rs index 583a1e0657c..ae12f944f9c 100644 --- a/src/libstd/rt/task.rs +++ b/src/libstd/rt/task.rs @@ -444,16 +444,20 @@ mod test { #[test] fn heap_cycles() { + use cell::RefCell; use option::{Option, Some, None}; struct List { - next: Option<@mut List>, + next: Option<@RefCell>, } - let a = @mut List { next: None }; - let b = @mut List { next: Some(a) }; + let a = @RefCell::new(List { next: None }); + let b = @RefCell::new(List { next: Some(a) }); - a.next = Some(b); + { + let mut a = a.borrow_mut(); + a.get().next = Some(b); + } } #[test] -- cgit 1.4.1-3-g733a5