@@ -17,27 +17,15 @@ 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:
20+ /// This allows to index the IndexVec with the new index type
2121///
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- /// ```
3422///
3523/// [`newtype_index!`]: ../macro.newtype_index.html
3624#[ derive( Clone , PartialEq , Eq , Hash ) ]
3725#[ repr( transparent) ]
3826pub struct IndexVec < I : Idx , T > {
3927 pub raw : Vec < T > ,
40- _marker : PhantomData < fn ( & I ) > ,
28+ _marker : PhantomData < I > ,
4129}
4230
4331impl < I : Idx , T > IndexVec < I , T > {
@@ -77,7 +65,7 @@ impl<I: Idx, T> IndexVec<I, T> {
7765 IndexVec :: from_raw ( vec ! [ elem; universe. len( ) ] )
7866 }
7967
80- /// Creates a new ` IndexVec` with n copies of `elem`
68+ /// Creates a new IndexVec
8169 #[ inline]
8270 pub fn from_elem_n ( elem : T , n : usize ) -> Self
8371 where
0 commit comments