summaryrefslogtreecommitdiff
path: root/Defer borrow checking to runtime with garbage collection.md
diff options
context:
space:
mode:
authorJasper Ras <jras@hostnet.nl>2025-08-08 22:44:15 +0200
committerJasper Ras <jras@hostnet.nl>2025-08-08 22:44:15 +0200
commit22675cd8dc75d8b8d4b0f818f5b093efbc364802 (patch)
tree90156d37dccf13f012d535e7d92273259e3d5c17 /Defer borrow checking to runtime with garbage collection.md
parent295b343aecf330e830d79f06e0efc511e7d76da1 (diff)
vault backup: 2025-08-08 22:44:15HEADmain
Diffstat (limited to 'Defer borrow checking to runtime with garbage collection.md')
-rw-r--r--Defer borrow checking to runtime with garbage collection.md11
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)
+}
+```
+