From 22675cd8dc75d8b8d4b0f818f5b093efbc364802 Mon Sep 17 00:00:00 2001 From: Jasper Ras Date: Fri, 8 Aug 2025 22:44:15 +0200 Subject: vault backup: 2025-08-08 22:44:15 --- Defer borrow checking to runtime with garbage collection.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 Defer borrow checking to runtime with garbage collection.md (limited to 'Defer borrow checking to runtime with garbage collection.md') 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 { + let s = Rc::new(String::from("Hello")); + Rc::clone(&s) +} +``` + -- cgit v1.2.3