summaryrefslogtreecommitdiff
path: root/Rust.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 /Rust.md
parent295b343aecf330e830d79f06e0efc511e7d76da1 (diff)
vault backup: 2025-08-08 22:44:15HEADmain
Diffstat (limited to 'Rust.md')
-rw-r--r--Rust.md21
1 files changed, 17 insertions, 4 deletions
diff --git a/Rust.md b/Rust.md
index be302f9..d053f90 100644
--- a/Rust.md
+++ b/Rust.md
@@ -26,10 +26,23 @@
[[Returning values from loops]]
[[Loop over an array with for-in]]
[[Undefined behaviour is caught by the compiler]]
-[[Variables lives in the stack]]
-[[Boxes live in the heap]]
+[[Variables lives on the stack]]
+[[To put data on the heap use a Box]]
[[Cloning a box does a deep copy of the heap data]]
-[[Aliasing is accessing the same data through different variables]]
-[[Borrow checker]]
+[[Aliasing just means that multiple variables point to the same heap data]]
[[A place is anything that is valid to put on the left-hand side of an assignment]]
+[[Ownership]]
+[[Dereferencing is to access the data behind a pointer]]
+[[Aliasing just means that multiple variables point to the same heap data]]
+[[Variables are subject to permissions similar to files on linux]]
+[[References temporarily remove permissions]]
+[[Creating a reference to a variable is called borrowing]]
+[[It is illegal to create a mutable reference while an immutable reference is live]]
+[[Data must outlive any references to it]]
+[[Move ownership out of the function]]
+[[Return a static literal]]
+[[Defer borrow checking to runtime with garbage collection]]
+[[Provide a slot by the caller]]
+[[Clone a reference in a function to modify it]]
+[[Shortening the lifetime of borrowed variables before mutating it]]