1
Fork 0

Rollup merge of #109913 - scottmcm:index-slice, r=WaffleLapkin

Doc-comment  `IndexVec::from_elem` and use it in a few more places

Since this PR is a reply to https://github.com/rust-lang/rust/pull/109819#discussion_r1156128164,
r? ``@WaffleLapkin``
This commit is contained in:
Michael Goulet 2023-04-04 09:27:45 -07:00 committed by GitHub
commit 5485a54e19
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 17 additions and 7 deletions

View file

@ -203,7 +203,7 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
// Tracks the `VarSubVar` constraints generated for each region vid. We
// later use this to expand across vids.
let mut constraints = IndexVec::from_elem_n(Vec::new(), var_values.values.len());
let mut constraints = IndexVec::from_elem(Vec::new(), &var_values.values);
// Tracks the changed region vids.
let mut changes = Vec::new();
for constraint in self.data.constraints.keys() {