summaryrefslogtreecommitdiff
path: root/Notes
diff options
context:
space:
mode:
authorJohn Hodge <tpg@ucc.asn.au>2018-06-03 14:57:05 +0800
committerJohn Hodge <tpg@ucc.asn.au>2018-06-03 14:57:05 +0800
commitbf8f8b4b4a9fe273451be59f68acafbe61968b83 (patch)
tree82993550cb3c88de0edbd55d79e4ea8e8cefffac /Notes
parent39b3cf53798683e496804f8322da2254b10850f4 (diff)
parenta7fb27789a2b34543851d207120e2c0001ee9c27 (diff)
downloadmrust-bf8f8b4b4a9fe273451be59f68acafbe61968b83.tar.gz
Merge branch 'master' of https://github.com/thepowersgang/mrustc
Diffstat (limited to 'Notes')
-rw-r--r--Notes/BorrowChecker.md22
1 files changed, 22 insertions, 0 deletions
diff --git a/Notes/BorrowChecker.md b/Notes/BorrowChecker.md
index 78b46ff5..d01fcb40 100644
--- a/Notes/BorrowChecker.md
+++ b/Notes/BorrowChecker.md
@@ -1,3 +1,25 @@
+
+Lifetime Annotations
+====================
+
+Problems
+--------
+
+Higher-ranked bounds (lifetimes) can be nested, and typecheck/inferrence can change that nesting after resolve
+- Potential solution: each HRB block (`for<...>`) is numbered within one of three scopes, the impl scope, item scope, and body scope.
+ - Impl scope is for bounds that are visible for the entire `impl` or type block
+ - Item scope is for bounds visible within the current impl item (`fn`, `type`, ...)
+ - Body scope is for bounds within the body of a function (e.g. in type annotations)
+ - Each of these scopes specifies a prefix to the binding IDs, similar to how currently there's three prefixes for generics (impl, item, placeholder)
+
+Region inferrence
+- To what extent does type inferrene play into lifetime inferrence? Can lifetimes be inferred as a second pass after
+ types are concretely known, or do they play into each other?
+
+
+Notes on Borrowck
+=================
+
- 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