about summary refs log tree commit diff
path: root/src/libarena
diff options
context:
space:
mode:
authorOGINO Masanori <masanori.ogino@gmail.com>2014-07-31 07:56:39 +0900
committerAlex Crichton <alex@alexcrichton.com>2014-07-31 11:50:24 -0700
commitf86184869a95199a2e0da844ad257c67f1aac97a (patch)
tree5042e78e28e8a5fd15305690af86435d1b7f7b2e /src/libarena
parent2467c6e5a7fe008c33fdc1060a5ce869d6219a92 (diff)
alloc, arena, test, url, uuid: Elide lifetimes.
Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
Diffstat (limited to 'src/libarena')
-rw-r--r--src/libarena/lib.rs12
1 files changed, 6 insertions, 6 deletions
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<T>(&self, op: || -> T) -> &T {
         unsafe {
             let ptr = self.alloc_copy_inner(mem::size_of::<T>(),
                                             mem::min_align_of::<T>());
@@ -261,7 +261,7 @@ impl Arena {
     }
 
     #[inline]
-    fn alloc_noncopy<'a, T>(&'a self, op: || -> T) -> &'a T {
+    fn alloc_noncopy<T>(&self, op: || -> T) -> &T {
         unsafe {
             let tydesc = get_tydesc::<T>();
             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<T>(&self, op: || -> T) -> &T {
         unsafe {
             if intrinsics::needs_drop::<T>() {
                 self.alloc_noncopy(op)
@@ -458,13 +458,13 @@ impl<T> TypedArena<T> {
 
     /// 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