diff --git a/src/liballoc/rc.rs b/src/liballoc/rc.rs index b31931c6de3..35914aa3541 100644 --- a/src/liballoc/rc.rs +++ b/src/liballoc/rc.rs @@ -226,7 +226,7 @@ impl Rc { /// data is cloned if the reference count is greater than one. #[inline] #[experimental] - pub fn make_unique<'a>(&'a mut self) -> &'a mut T { + pub fn make_unique(&mut self) -> &mut T { // Note that we hold a strong reference, which also counts as // a weak reference, so we only clone if there is an // additional reference of either kind. @@ -247,7 +247,7 @@ impl Rc { impl Deref for Rc { /// Borrow the value contained in the reference-counted box #[inline(always)] - fn deref<'a>(&'a self) -> &'a T { + fn deref(&self) -> &T { &self.inner().value } } @@ -390,7 +390,7 @@ impl Clone for Weak { #[doc(hidden)] trait RcBoxPtr { - fn inner<'a>(&'a self) -> &'a RcBox; + fn inner(&self) -> &RcBox; #[inline] fn strong(&self) -> uint { self.inner().strong.get() } @@ -413,12 +413,12 @@ trait RcBoxPtr { impl RcBoxPtr for Rc { #[inline(always)] - fn inner<'a>(&'a self) -> &'a RcBox { unsafe { &(*self._ptr) } } + fn inner(&self) -> &RcBox { unsafe { &(*self._ptr) } } } impl RcBoxPtr for Weak { #[inline(always)] - fn inner<'a>(&'a self) -> &'a RcBox { unsafe { &(*self._ptr) } } + fn inner(&self) -> &RcBox { unsafe { &(*self._ptr) } } } #[cfg(test)] diff --git a/src/libarena/lib.rs b/src/libarena/lib.rs index e672c555b80..5d316cdb51e 100644 --- a/src/libarena/lib.rs +++ b/src/libarena/lib.rs @@ -207,7 +207,7 @@ impl Arena { } #[inline] - fn alloc_copy<'a, T>(&'a self, op: || -> T) -> &'a T { + fn alloc_copy(&self, op: || -> T) -> &T { unsafe { let ptr = self.alloc_copy_inner(mem::size_of::(), mem::min_align_of::()); @@ -261,7 +261,7 @@ impl Arena { } #[inline] - fn alloc_noncopy<'a, T>(&'a self, op: || -> T) -> &'a T { + fn alloc_noncopy(&self, op: || -> T) -> &T { unsafe { let tydesc = get_tydesc::(); let (ty_ptr, ptr) = @@ -285,7 +285,7 @@ impl Arena { /// Allocate a new item in the arena, using `op` to initialize the value /// and returning a reference to it. #[inline] - pub fn alloc<'a, T>(&'a self, op: || -> T) -> &'a T { + pub fn alloc(&self, op: || -> T) -> &T { unsafe { if intrinsics::needs_drop::() { self.alloc_noncopy(op) @@ -458,13 +458,13 @@ impl TypedArena { /// Allocates an object in the TypedArena, returning a reference to it. #[inline] - pub fn alloc<'a>(&'a self, object: T) -> &'a T { + pub fn alloc(&self, object: T) -> &T { if self.ptr == self.end { self.grow() } - let ptr: &'a T = unsafe { - let ptr: &'a mut T = mem::transmute(self.ptr); + let ptr: &T = unsafe { + let ptr: &mut T = mem::transmute(self.ptr); ptr::write(ptr, object); self.ptr.set(self.ptr.get().offset(1)); ptr diff --git a/src/libtest/stats.rs b/src/libtest/stats.rs index d8f628e2196..9af28e771e1 100644 --- a/src/libtest/stats.rs +++ b/src/libtest/stats.rs @@ -164,7 +164,7 @@ impl Summary { } } -impl<'a,T: FloatMath + FromPrimitive> Stats for &'a [T] { +impl<'a, T: FloatMath + FromPrimitive> Stats for &'a [T] { // FIXME #11059 handle NaN, inf and overflow fn sum(self) -> T { diff --git a/src/liburl/lib.rs b/src/liburl/lib.rs index c7e27c00836..0221b95b404 100644 --- a/src/liburl/lib.rs +++ b/src/liburl/lib.rs @@ -394,7 +394,7 @@ pub fn decode_form_urlencoded(s: &[u8]) } } -fn split_char_first<'a>(s: &'a str, c: char) -> (&'a str, &'a str) { +fn split_char_first(s: &str, c: char) -> (&str, &str) { let mut iter = s.splitn(c, 1); match (iter.next(), iter.next()) { @@ -466,7 +466,7 @@ pub fn query_to_str(query: &Query) -> String { /// }; /// println!("Scheme in use: {}.", scheme); // Scheme in use: https. /// ``` -pub fn get_scheme<'a>(rawurl: &'a str) -> DecodeResult<(&'a str, &'a str)> { +pub fn get_scheme(rawurl: &str) -> DecodeResult<(&str, &str)> { for (i,c) in rawurl.chars().enumerate() { let result = match c { 'A' .. 'Z' @@ -493,8 +493,8 @@ pub fn get_scheme<'a>(rawurl: &'a str) -> DecodeResult<(&'a str, &'a str)> { } // returns userinfo, host, port, and unparsed part, or an error -fn get_authority<'a>(rawurl: &'a str) -> - DecodeResult<(Option, &'a str, Option, &'a str)> { +fn get_authority(rawurl: &str) -> + DecodeResult<(Option, &str, Option, &str)> { enum State { Start, // starting state PassHostPort, // could be in user or port @@ -662,8 +662,7 @@ fn get_authority<'a>(rawurl: &'a str) -> // returns the path and unparsed part of url, or an error -fn get_path<'a>(rawurl: &'a str, is_authority: bool) - -> DecodeResult<(String, &'a str)> { +fn get_path(rawurl: &str, is_authority: bool) -> DecodeResult<(String, &str)> { let len = rawurl.len(); let mut end = len; for (i,c) in rawurl.chars().enumerate() { diff --git a/src/libuuid/lib.rs b/src/libuuid/lib.rs index d5fbb321cd8..6a5148c4a94 100644 --- a/src/libuuid/lib.rs +++ b/src/libuuid/lib.rs @@ -313,7 +313,7 @@ impl Uuid { } /// Return an array of 16 octets containing the UUID data - pub fn as_bytes<'a>(&'a self) -> &'a [u8] { + pub fn as_bytes(&self) -> &[u8] { self.bytes.as_slice() }