-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Labels
C-cleanupCategory: PRs that clean code up or issues documenting cleanup.Category: PRs that clean code up or issues documenting cleanup.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
The IndexSlice
internal type has two methods
- https://doc.rust-lang.org/nightly/nightly-rustc/rustc_index/struct.IndexSlice.html#method.pick2_mut
- https://doc.rust-lang.org/nightly/nightly-rustc/rustc_index/struct.IndexSlice.html#method.pick3_mut
that offer a safe interface to getting multiple mutable borrows into the slice.
Now that https://doc.rust-lang.org/beta/std/primitive.slice.html#method.get_disjoint_mut exists, their current non-trivial implementations can be replaced with a call to that stabilized method (and some pattern-matching and unwrapping).
It's probably not worth changing all the code to stop using pick[23]_mut
; just swapping out the implementation is enough.
Metadata
Metadata
Assignees
Labels
C-cleanupCategory: PRs that clean code up or issues documenting cleanup.Category: PRs that clean code up or issues documenting cleanup.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.