add c
This commit is contained in:
15
single_file_tests/rc.rs
Normal file
15
single_file_tests/rc.rs
Normal file
@@ -0,0 +1,15 @@
|
||||
use std::rc::Rc;
|
||||
|
||||
fn main() {
|
||||
let a = Rc::new(0);
|
||||
|
||||
println!("{}", Rc::strong_count(&a));
|
||||
let b = a.clone();
|
||||
println!("{}", Rc::strong_count(&a));
|
||||
let c = Rc::clone(&a);
|
||||
println!("{}", Rc::strong_count(&a));
|
||||
|
||||
println!("{}", a);
|
||||
println!("{}", b);
|
||||
println!("{}", c);
|
||||
}
|
||||
Reference in New Issue
Block a user