diff options
Diffstat (limited to 'Defer borrow checking to runtime with garbage collection.md')
-rw-r--r-- | Defer borrow checking to runtime with garbage collection.md | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Defer borrow checking to runtime with garbage collection.md b/Defer borrow checking to runtime with garbage collection.md new file mode 100644 index 0000000..fbbf634 --- /dev/null +++ b/Defer borrow checking to runtime with garbage collection.md @@ -0,0 +1,11 @@ +It's possible to tell the compiler that we want something garbage collected. + +Reference counted pointer: +```rust +use std::rc::Rc +fn return() -> Rc<String> { + let s = Rc::new(String::from("Hello")); + Rc::clone(&s) +} +``` + |