Skip to content

Commit f97bc47

Browse files
committed
Oh well
1 parent 281ceb2 commit f97bc47

File tree

1 file changed

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

1 file changed

+2
-15
lines changed

compiler/rustc_index/src/vec.rs

+2-15
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,7 @@ use crate::{Idx, IndexSlice};
1717
/// While it's possible to use `u32` or `usize` directly for `I`,
1818
/// you almost certainly want to use a [`newtype_index!`]-generated type instead.
1919
///
20-
/// This allows to index the IndexVec with the new index type:
21-
///
22-
/// ```
23-
/// use crate as rustc_index;
24-
/// use rustc_index::{IndexVec, newtype_index};
25-
///
26-
/// newtype_index! {
27-
/// pub struct MyIdx {}
28-
/// }
29-
///
30-
/// let my_index_vec: IndexVec<MyIdx, u32> = IndexVec::from_raw(vec![0,1,2,3]);
31-
/// let idx: MyIdx = MyIdx::from_u32(2);
32-
/// assert_eq!(my_index_vec[idx], 2);
33-
/// ```
20+
/// This allows to index the IndexVec with the new index type
3421
///
3522
/// [`newtype_index!`]: ../macro.newtype_index.html
3623
#[derive(Clone, PartialEq, Eq, Hash)]
@@ -77,7 +64,7 @@ impl<I: Idx, T> IndexVec<I, T> {
7764
IndexVec::from_raw(vec![elem; universe.len()])
7865
}
7966

80-
/// Creates a new `IndexVec` with n copies of `elem`
67+
/// Creates a new IndexVec`
8168
#[inline]
8269
pub fn from_elem_n(elem: T, n: usize) -> Self
8370
where

0 commit comments

Comments
 (0)