From eef969a23fad3be3cfd6078cf6e0d7b1204ca5fb Mon Sep 17 00:00:00 2001 From: Clark Gaebel Date: Mon, 3 Nov 2014 12:03:47 -0800 Subject: [PATCH] Removes the useless 'static constraint on SmallVec. It was likely added accidentally after a rustc upgrade. r? @jdm --- components/util/smallvec.rs | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/components/util/smallvec.rs b/components/util/smallvec.rs index b1fbffb2075..b8f1e62e0ae 100644 --- a/components/util/smallvec.rs +++ b/components/util/smallvec.rs @@ -57,7 +57,7 @@ pub trait SmallVecPrivate { unsafe fn set_ptr(&mut self, new_ptr: *mut T); } -pub trait SmallVec : SmallVecPrivate where T: 'static { +pub trait SmallVec : SmallVecPrivate { fn inline_size(&self) -> uint; fn len(&self) -> uint; fn is_empty(&self) -> bool; @@ -294,11 +294,11 @@ impl<'a,T> Iterator<&'a mut T> for SmallVecMutIterator<'a,T> { pub struct SmallVecMoveIterator<'a,T> { allocation: Option<*mut u8>, cap: uint, - iter: SmallVecIterator<'static,T>, + iter: SmallVecIterator<'a,T>, lifetime: ContravariantLifetime<'a>, } -impl<'a, T: 'static> Iterator for SmallVecMoveIterator<'a,T> { +impl<'a, T: 'a> Iterator for SmallVecMoveIterator<'a,T> { #[inline] fn next(&mut self) -> Option { unsafe { @@ -315,7 +315,7 @@ impl<'a, T: 'static> Iterator for SmallVecMoveIterator<'a,T> { } #[unsafe_destructor] -impl<'a, T: 'static> Drop for SmallVecMoveIterator<'a,T> { +impl<'a, T: 'a> Drop for SmallVecMoveIterator<'a,T> { fn drop(&mut self) { // Destroy the remaining elements. for _ in *self {} @@ -344,7 +344,7 @@ macro_rules! def_small_vector( data: [T, ..$size], } - impl SmallVecPrivate for $name { + impl SmallVecPrivate for $name { unsafe fn set_len(&mut self, new_len: uint) { self.len = new_len } @@ -370,7 +370,7 @@ macro_rules! def_small_vector( } } - impl SmallVec for $name { + impl SmallVec for $name { fn inline_size(&self) -> uint { $size } @@ -385,7 +385,7 @@ macro_rules! def_small_vector( } } - impl VecLike for $name { + impl VecLike for $name { #[inline] fn vec_len(&self) -> uint { self.len() @@ -402,7 +402,7 @@ macro_rules! def_small_vector( } } - impl FromIterator for $name { + impl FromIterator for $name { fn from_iter>(mut iter: I) -> $name { let mut v = $name::new(); @@ -420,7 +420,7 @@ macro_rules! def_small_vector( } } - impl Extendable for $name { + impl Extendable for $name { fn extend>(&mut self, mut iter: I) { let (lower_size_bound, _) = iter.size_hint(); @@ -436,13 +436,13 @@ macro_rules! def_small_vector( } } - impl fmt::Show for $name { + impl fmt::Show for $name { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{}", self.as_slice()) } } - impl $name { + impl $name { #[inline] pub fn new() -> $name { unsafe { @@ -469,7 +469,7 @@ def_small_vector!(SmallVec32, 32) macro_rules! def_small_vector_drop_impl( ($name:ident, $size:expr) => ( #[unsafe_destructor] - impl Drop for $name { + impl Drop for $name { fn drop(&mut self) { if !self.spilled() { return @@ -500,7 +500,7 @@ def_small_vector_drop_impl!(SmallVec32, 32) macro_rules! def_small_vector_clone_impl( ($name:ident) => ( - impl Clone for $name { + impl Clone for $name { fn clone(&self) -> $name { let mut new_vector = $name::new(); for element in self.iter() {