Skip to content

Commit 736fc96

Browse files
committed
Remove useless Clone bound in IndexVec.
1 parent 3a5d45f commit 736fc96

File tree

1 file changed

+7
-7
lines changed
  • compiler/rustc_index/src

1 file changed

+7
-7
lines changed

compiler/rustc_index/src/vec.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -695,9 +695,7 @@ impl<I: Idx, T> IndexVec<I, T> {
695695
pub fn convert_index_type<Ix: Idx>(self) -> IndexVec<Ix, T> {
696696
IndexVec { raw: self.raw, _marker: PhantomData }
697697
}
698-
}
699698

700-
impl<I: Idx, T: Clone> IndexVec<I, T> {
701699
/// Grows the index vector so that it contains an entry for
702700
/// `elem`; if that is already true, then has no
703701
/// effect. Otherwise, inserts new values as needed by invoking
@@ -710,18 +708,20 @@ impl<I: Idx, T: Clone> IndexVec<I, T> {
710708
}
711709
}
712710

713-
#[inline]
714-
pub fn resize(&mut self, new_len: usize, value: T) {
715-
self.raw.resize(new_len, value)
716-
}
717-
718711
#[inline]
719712
pub fn resize_to_elem(&mut self, elem: I, fill_value: impl FnMut() -> T) {
720713
let min_new_len = elem.index() + 1;
721714
self.raw.resize_with(min_new_len, fill_value);
722715
}
723716
}
724717

718+
impl<I: Idx, T: Clone> IndexVec<I, T> {
719+
#[inline]
720+
pub fn resize(&mut self, new_len: usize, value: T) {
721+
self.raw.resize(new_len, value)
722+
}
723+
}
724+
725725
impl<I: Idx, T: Ord> IndexVec<I, T> {
726726
#[inline]
727727
pub fn binary_search(&self, value: &T) -> Result<I, I> {

0 commit comments

Comments
 (0)