diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2018-09-21 19:26:24 -0400 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2018-09-26 09:38:26 -0400 |
| commit | 0b4791e60bb44ae7dcf3b4bb312cc20b99193c4e (patch) | |
| tree | 176a365738028b1089019b2af49cac5e9afe8398 /src/librustc_data_structures | |
| parent | 0f5dae0322ac47ea457aafadc11fc0eb6c8f2449 (diff) | |
| download | rust-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.rs | 7 |
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() |
