about summary refs log tree commit diff
diff options
context:
space:
mode:
authorKeegan McAllister <mcallister.keegan@gmail.com>2015-02-18 18:08:35 -0800
committerKeegan McAllister <mcallister.keegan@gmail.com>2015-02-18 19:54:38 -0800
commit160cf962e7efaca024202421e58a5c83f0d1cbe8 (patch)
treeecdc698b7ab6757addb9e80954c545bff2d8e390
parent0c1fc1ca7b3b4c67e362e89e4cec33854d1e7de6 (diff)
downloadrust-160cf962e7efaca024202421e58a5c83f0d1cbe8.tar.gz
rust-160cf962e7efaca024202421e58a5c83f0d1cbe8.zip
borrowck/README.md: Remove SCOPE (mostly unused)
Only one case is used in the text.  All of them are pretty straightforward, so
I don't think the code needs an explicit link to the README.
-rw-r--r--src/librustc_borrowck/borrowck/README.md36
-rw-r--r--src/librustc_borrowck/borrowck/gather_loans/lifetime.rs2
2 files changed, 1 insertions, 37 deletions
diff --git a/src/librustc_borrowck/borrowck/README.md b/src/librustc_borrowck/borrowck/README.md
index 9eb1576e757..619301f17dd 100644
--- a/src/librustc_borrowck/borrowck/README.md
+++ b/src/librustc_borrowck/borrowck/README.md
@@ -375,40 +375,6 @@ Formally, we define a predicate `LIFETIME(LV, LT, MQ)`, which states that
 `MQ`". The Rust code corresponding to this predicate is the module
 `middle::borrowck::gather_loans::lifetime`.
 
-### The Scope function
-
-Several of the rules refer to a helper function `SCOPE(LV)=LT`.  The
-`SCOPE(LV)` yields the lifetime `LT` for which the lvalue `LV` is
-guaranteed to exist, presuming that no mutations occur.
-
-The scope of a local variable is the block where it is declared:
-
-```text
-  SCOPE(X) = block where X is declared
-```
-
-The scope of a field is the scope of the struct:
-
-```text
-  SCOPE(LV.f) = SCOPE(LV)
-```
-
-The scope of a unique referent is the scope of the pointer, since
-(barring mutation or moves) the pointer will not be freed until
-the pointer itself `LV` goes out of scope:
-
-```text
-  SCOPE(*LV) = SCOPE(LV) if LV has type Box<T>
-```
-
-The scope of a borrowed referent is the scope associated with the
-pointer.  This is a conservative approximation, since the data that
-the pointer points at may actually live longer:
-
-```text
-  SCOPE(*LV) = LT if LV has type &'LT T or &'LT mut T
-```
-
 ### Checking lifetime of variables
 
 The rule for variables states that a variable can only be borrowed a
@@ -416,7 +382,7 @@ lifetime `LT` that is a subregion of the variable's scope:
 
 ```text
 LIFETIME(X, LT, MQ)                 // L-Local
-  LT <= SCOPE(X)
+  LT <= block where X is declared
 ```
 
 ### Checking lifetime for owned content
diff --git a/src/librustc_borrowck/borrowck/gather_loans/lifetime.rs b/src/librustc_borrowck/borrowck/gather_loans/lifetime.rs
index 1c57097ae26..9f7b4cf26e1 100644
--- a/src/librustc_borrowck/borrowck/gather_loans/lifetime.rs
+++ b/src/librustc_borrowck/borrowck/gather_loans/lifetime.rs
@@ -106,8 +106,6 @@ impl<'a, 'tcx> GuaranteeLifetimeContext<'a, 'tcx> {
         //! lvalue `cmt` is guaranteed to be valid without any
         //! rooting etc, and presuming `cmt` is not mutated.
 
-        // See the SCOPE(LV) function in doc.rs
-
         match cmt.cat {
             mc::cat_rvalue(temp_scope) => {
                 temp_scope