about summary refs log tree commit diff
path: root/src/librustc_data_structures
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2018-09-21 19:26:24 -0400
committerNiko Matsakis <niko@alum.mit.edu>2018-09-26 09:38:26 -0400
commit0b4791e60bb44ae7dcf3b4bb312cc20b99193c4e (patch)
tree176a365738028b1089019b2af49cac5e9afe8398 /src/librustc_data_structures
parent0f5dae0322ac47ea457aafadc11fc0eb6c8f2449 (diff)
downloadrust-0b4791e60bb44ae7dcf3b4bb312cc20b99193c4e.tar.gz
rust-0b4791e60bb44ae7dcf3b4bb312cc20b99193c4e.zip
make NLL handle `IfEq` bounds by using SCC normalization
Diffstat (limited to 'src/librustc_data_structures')
-rw-r--r--src/librustc_data_structures/indexed_vec.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/librustc_data_structures/indexed_vec.rs b/src/librustc_data_structures/indexed_vec.rs
index 2f11fea46d6..a59bf9d530c 100644
--- a/src/librustc_data_structures/indexed_vec.rs
+++ b/src/librustc_data_structures/indexed_vec.rs
@@ -535,6 +535,13 @@ impl<I: Idx, T> IndexVec<I, T> {
         self.raw.len()
     }
 
+    /// Gives the next index that will be assigned when `push` is
+    /// called.
+    #[inline]
+    pub fn next_index(&self) -> I {
+        I::new(self.len())
+    }
+
     #[inline]
     pub fn is_empty(&self) -> bool {
         self.raw.is_empty()