mirror of
https://github.com/KaiserY/trpl-zh-cn
synced 2024-11-14 21:11:31 +08:00
12 lines
427 B
Plaintext
Executable File
12 lines
427 B
Plaintext
Executable File
$ cargo run
|
|
Compiling cons-list v0.1.0 (file:///projects/cons-list)
|
|
Finished dev [unoptimized + debuginfo] target(s) in 0.53s
|
|
Running `target/debug/cons-list`
|
|
a initial rc count = 1
|
|
a next item = Some(RefCell { value: Nil })
|
|
a rc count after b creation = 2
|
|
b initial rc count = 1
|
|
b next item = Some(RefCell { value: Cons(5, RefCell { value: Nil }) })
|
|
b rc count after changing a = 2
|
|
a rc count after changing a = 2
|