summaryrefslogtreecommitdiff
path: root/Notes/BorrowChecker.md
diff options
context:
space:
mode:
authorJohn Hodge (bugs) <tpg@mutabah.net>2017-05-14 12:01:45 +0800
committerJohn Hodge (bugs) <tpg@mutabah.net>2017-05-14 12:01:45 +0800
commit1d2fe7681219700998c8ecbdb8ed5acab66578df (patch)
tree0d38e8ab5fd80c890d3dec67a0596abfc7a4f0cd /Notes/BorrowChecker.md
parentc6fca061dd134068c831aefd88d9535a30f423ed (diff)
parentfde22b3f03d802231985b8ded567cba16cb5aa00 (diff)
downloadmrust-1d2fe7681219700998c8ecbdb8ed5acab66578df.tar.gz
Merge branch 'master' of https://github.com/thepowersgang/mrustc
# Conflicts: # src/common.hpp # src/hir/deserialise.cpp # src/hir_typeck/static.cpp # src/mir/from_hir.cpp # src/mir/from_hir.hpp # src/mir/from_hir_match.cpp # src/mir/helpers.hpp # src/mir/mir_builder.cpp
Diffstat (limited to 'Notes/BorrowChecker.md')
-rw-r--r--Notes/BorrowChecker.md7
1 files changed, 7 insertions, 0 deletions
diff --git a/Notes/BorrowChecker.md b/Notes/BorrowChecker.md
new file mode 100644
index 00000000..78b46ff5
--- /dev/null
+++ b/Notes/BorrowChecker.md
@@ -0,0 +1,7 @@
+- On borrow, calculate lifetime of asignment (using existing lifetime code)
+ - Ignore reborrows?
+- Visit all statements in that lifetime and locate places where the borrow is propagated/stored
+ - Requires lifetime parameters on functions/&-ptrs to be present
+- Assignment of the source value during the lifetime of the borrow is an error
+- Dropping of the source value is an error
+- Returning the borrow is an error