about summary refs log tree commit diff
path: root/compiler/rustc_borrowck/src/member_constraints.rs
diff options
context:
space:
mode:
authorScott McMurray <scottmcm@users.noreply.github.com>2023-03-31 00:32:44 -0700
committerScott McMurray <scottmcm@users.noreply.github.com>2023-04-02 17:35:37 -0700
commita2ee7592d6b7c0daa62b7870ade85e0cc0acca05 (patch)
tree4ab6bedbd53989ea3c1b556e4d61c33f469c536b /compiler/rustc_borrowck/src/member_constraints.rs
parenta93bcdc30771340dfff914a1cf48556886ad33a6 (diff)
downloadrust-a2ee7592d6b7c0daa62b7870ade85e0cc0acca05.tar.gz
rust-a2ee7592d6b7c0daa62b7870ade85e0cc0acca05.zip
Use `&IndexSlice` instead of `&IndexVec` where possible
All the same reasons as for `[T]`: more general, less pointer chasing, and `&mut IndexSlice` emphasizes that it doesn't change *length*.
Diffstat (limited to 'compiler/rustc_borrowck/src/member_constraints.rs')
-rw-r--r--compiler/rustc_borrowck/src/member_constraints.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_borrowck/src/member_constraints.rs b/compiler/rustc_borrowck/src/member_constraints.rs
index b6c5d4245d7..f637e6a95ac 100644
--- a/compiler/rustc_borrowck/src/member_constraints.rs
+++ b/compiler/rustc_borrowck/src/member_constraints.rs
@@ -2,7 +2,7 @@
 #![deny(rustc::diagnostic_outside_of_impl)]
 use rustc_data_structures::captures::Captures;
 use rustc_data_structures::fx::FxIndexMap;
-use rustc_index::vec::IndexVec;
+use rustc_index::vec::{IndexSlice, IndexVec};
 use rustc_middle::infer::MemberConstraint;
 use rustc_middle::ty::{self, Ty};
 use rustc_span::Span;
@@ -215,7 +215,7 @@ where
 /// target_list: A -> B -> C -> D -> E -> F -> (None)
 /// ```
 fn append_list(
-    constraints: &mut IndexVec<NllMemberConstraintIndex, NllMemberConstraint<'_>>,
+    constraints: &mut IndexSlice<NllMemberConstraintIndex, NllMemberConstraint<'_>>,
     target_list: NllMemberConstraintIndex,
     source_list: NllMemberConstraintIndex,
 ) {