Skip to content

Implement pick[23]_mut via get_disjoint_mut [rustc cleanup] #138196

@scottmcm

Description

@scottmcm

The IndexSlice internal type has two methods

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.E-easyCall 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.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions