diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-07-21 18:42:10 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-21 18:42:10 +0200 |
| commit | 14c385d3d69fcef380bc0d629c040eb63ddc15a9 (patch) | |
| tree | e33cba55068a1cf46c16a5a2f19d953b679b08cd | |
| parent | 31284d2ef2c0a09cf719269cf21f0286ed074bb4 (diff) | |
| parent | aad1aa34085b2d4a6a2bf926c2ba1e3f294dd0f7 (diff) | |
| download | rust-14c385d3d69fcef380bc0d629c040eb63ddc15a9.tar.gz rust-14c385d3d69fcef380bc0d629c040eb63ddc15a9.zip | |
Rollup merge of #99557 - pierwill:patch-6, r=tmiasko
Edit `rustc_index::vec::IndexVec::pick3_mut` docs Clarify when this method will panic. Part of #93792.
| -rw-r--r-- | compiler/rustc_index/src/vec.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler/rustc_index/src/vec.rs b/compiler/rustc_index/src/vec.rs index 1a55519d7b1..30ff364210d 100644 --- a/compiler/rustc_index/src/vec.rs +++ b/compiler/rustc_index/src/vec.rs @@ -234,7 +234,9 @@ impl<I: Idx, T> IndexVec<I, T> { self.raw.get_mut(index.index()) } - /// Returns mutable references to two distinct elements, a and b. Panics if a == b. + /// Returns mutable references to two distinct elements, `a` and `b`. + /// + /// Panics if `a == b`. #[inline] pub fn pick2_mut(&mut self, a: I, b: I) -> (&mut T, &mut T) { let (ai, bi) = (a.index(), b.index()); @@ -249,7 +251,9 @@ impl<I: Idx, T> IndexVec<I, T> { } } - /// Returns mutable references to three distinct elements or panics otherwise. + /// Returns mutable references to three distinct elements. + /// + /// Panics if the elements are not distinct. #[inline] pub fn pick3_mut(&mut self, a: I, b: I, c: I) -> (&mut T, &mut T, &mut T) { let (ai, bi, ci) = (a.index(), b.index(), c.index()); |
