Skip to content

Commit 14c385d

Browse files
authored
Rollup merge of rust-lang#99557 - pierwill:patch-6, r=tmiasko
Edit `rustc_index::vec::IndexVec::pick3_mut` docs Clarify when this method will panic. Part of rust-lang#93792.
2 parents 31284d2 + aad1aa3 commit 14c385d

File tree

1 file changed

+6
-2
lines changed
  • compiler/rustc_index/src

1 file changed

+6
-2
lines changed

compiler/rustc_index/src/vec.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,9 @@ impl<I: Idx, T> IndexVec<I, T> {
234234
self.raw.get_mut(index.index())
235235
}
236236

237-
/// Returns mutable references to two distinct elements, a and b. Panics if a == b.
237+
/// Returns mutable references to two distinct elements, `a` and `b`.
238+
///
239+
/// Panics if `a == b`.
238240
#[inline]
239241
pub fn pick2_mut(&mut self, a: I, b: I) -> (&mut T, &mut T) {
240242
let (ai, bi) = (a.index(), b.index());
@@ -249,7 +251,9 @@ impl<I: Idx, T> IndexVec<I, T> {
249251
}
250252
}
251253

252-
/// Returns mutable references to three distinct elements or panics otherwise.
254+
/// Returns mutable references to three distinct elements.
255+
///
256+
/// Panics if the elements are not distinct.
253257
#[inline]
254258
pub fn pick3_mut(&mut self, a: I, b: I, c: I) -> (&mut T, &mut T, &mut T) {
255259
let (ai, bi, ci) = (a.index(), b.index(), c.index());

0 commit comments

Comments
 (0)