Skip to content

Commit

Permalink
Oh well
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-ardi committed Jan 10, 2024
1 parent 281ceb2 commit f97bc47
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions compiler/rustc_index/src/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,7 @@ use crate::{Idx, IndexSlice};
/// While it's possible to use `u32` or `usize` directly for `I`,
/// you almost certainly want to use a [`newtype_index!`]-generated type instead.
///
/// This allows to index the IndexVec with the new index type:
///
/// ```
/// use crate as rustc_index;
/// use rustc_index::{IndexVec, newtype_index};
///
/// newtype_index! {
/// pub struct MyIdx {}
/// }
///
/// let my_index_vec: IndexVec<MyIdx, u32> = IndexVec::from_raw(vec![0,1,2,3]);
/// let idx: MyIdx = MyIdx::from_u32(2);
/// assert_eq!(my_index_vec[idx], 2);
/// ```
/// This allows to index the IndexVec with the new index type
///
/// [`newtype_index!`]: ../macro.newtype_index.html
#[derive(Clone, PartialEq, Eq, Hash)]
Expand Down Expand Up @@ -77,7 +64,7 @@ impl<I: Idx, T> IndexVec<I, T> {
IndexVec::from_raw(vec![elem; universe.len()])
}

/// Creates a new `IndexVec` with n copies of `elem`
/// Creates a new IndexVec`

Check failure on line 67 in compiler/rustc_index/src/vec.rs

View workflow job for this annotation

GitHub Actions / PR - mingw-check-tidy

comment with odd number of backticks
#[inline]
pub fn from_elem_n(elem: T, n: usize) -> Self
where
Expand Down

0 comments on commit f97bc47

Please sign in to comment.