summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2018-07-25 16:18:37 +0300
committerNiko Matsakis <niko@alum.mit.edu>2018-07-25 16:18:37 +0300
commitfa69e2183a97a139e1c5c5d4da9e8cd805d05084 (patch)
tree0d96fca2177fa9db2290fe045e88c7a80739265c /src
parent2acc3e7ce10012cb1ad41f139c1a58b2e97cbe7f (diff)
downloadrust-fa69e2183a97a139e1c5c5d4da9e8cd805d05084.tar.gz
rust-fa69e2183a97a139e1c5c5d4da9e8cd805d05084.zip
[3f0fb4f7] improve comment on `to_location`
Diffstat (limited to 'src')
-rw-r--r--src/librustc_mir/borrow_check/nll/region_infer/values.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/librustc_mir/borrow_check/nll/region_infer/values.rs b/src/librustc_mir/borrow_check/nll/region_infer/values.rs
index 2d7cbfce1a3..2503c943b7f 100644
--- a/src/librustc_mir/borrow_check/nll/region_infer/values.rs
+++ b/src/librustc_mir/borrow_check/nll/region_infer/values.rs
@@ -47,6 +47,7 @@ impl RegionValueElements {
         }
     }
 
+    /// Converts a `Location` into a `PointIndex`. O(1).
     fn point_from_location(&self, location: Location) -> PointIndex {
         let Location {
             block,
@@ -56,8 +57,8 @@ impl RegionValueElements {
         PointIndex::new(start_index + statement_index)
     }
 
-    /// Converts a particular `RegionElementIndex` to a location, if
-    /// that is what it represents. Returns `None` otherwise.
+    /// Converts a `PointIndex` back to a location. O(N) where N is
+    /// the number of blocks; could be faster if we ever cared.
     crate fn to_location(&self, i: PointIndex) -> Location {
         let point_index = i.index();