Skip to content

Commit e095889

Browse files
committed
libstd: De-@mut the heap_cycles test
1 parent aa93e6e commit e095889

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/libstd/rt/task.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -444,16 +444,20 @@ mod test {
444444
445445
#[test]
446446
fn heap_cycles() {
447+
use cell::RefCell;
447448
use option::{Option, Some, None};
448449
449450
struct List {
450-
next: Option<@mut List>,
451+
next: Option<@RefCell<List>>,
451452
}
452453
453-
let a = @mut List { next: None };
454-
let b = @mut List { next: Some(a) };
454+
let a = @RefCell::new(List { next: None });
455+
let b = @RefCell::new(List { next: Some(a) });
455456
456-
a.next = Some(b);
457+
{
458+
let mut a = a.borrow_mut();
459+
a.get().next = Some(b);
460+
}
457461
}
458462
459463
#[test]

0 commit comments

Comments
 (0)