We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
@mut
heap_cycles
1 parent aa93e6e commit e095889Copy full SHA for e095889
src/libstd/rt/task.rs
@@ -444,16 +444,20 @@ mod test {
444
445
#[test]
446
fn heap_cycles() {
447
+ use cell::RefCell;
448
use option::{Option, Some, None};
449
450
struct List {
- next: Option<@mut List>,
451
+ next: Option<@RefCell<List>>,
452
}
453
- let a = @mut List { next: None };
454
- let b = @mut List { next: Some(a) };
+ let a = @RefCell::new(List { next: None });
455
+ let b = @RefCell::new(List { next: Some(a) });
456
- a.next = Some(b);
457
+ {
458
+ let mut a = a.borrow_mut();
459
+ a.get().next = Some(b);
460
+ }
461
462
463
0 commit comments