diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2018-06-05 11:06:38 -0400 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2018-06-09 11:02:14 -0400 |
| commit | 6a5a4874a07767eb2f21b9fa2a3a7f71daaeb130 (patch) | |
| tree | da7434711220a7ef0c1073db3f11b50617e0f7eb /src/librustc_data_structures | |
| parent | ba6a7f7500381a111fd67b32abcac75349dd3807 (diff) | |
| download | rust-6a5a4874a07767eb2f21b9fa2a3a7f71daaeb130.tar.gz rust-6a5a4874a07767eb2f21b9fa2a3a7f71daaeb130.zip | |
convert type-check constraints into NLL constraints on the fly
We used to accumulate a vector of type-check constraints, but now we generate them as we go, and just store the NLL-style `OutlivesConstraint` and `TypeTest` information.
Diffstat (limited to 'src/librustc_data_structures')
| -rw-r--r-- | src/librustc_data_structures/indexed_vec.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/librustc_data_structures/indexed_vec.rs b/src/librustc_data_structures/indexed_vec.rs index 1fb63afc72f..ad3710e9536 100644 --- a/src/librustc_data_structures/indexed_vec.rs +++ b/src/librustc_data_structures/indexed_vec.rs @@ -368,6 +368,11 @@ impl<I: Idx, T> IndexVec<I, T> { } #[inline] + pub fn from_raw(raw: Vec<T>) -> Self { + IndexVec { raw, _marker: PhantomData } + } + + #[inline] pub fn with_capacity(capacity: usize) -> Self { IndexVec { raw: Vec::with_capacity(capacity), _marker: PhantomData } } |
