diff --git a/src/libarena/lib.rs b/src/libarena/lib.rs index 97621a2ac89..5bc1c44e1b1 100644 --- a/src/libarena/lib.rs +++ b/src/libarena/lib.rs @@ -245,7 +245,9 @@ impl<'longer_than_self> Arena<'longer_than_self> { } #[inline] - fn alloc_copy(&self, op: F) -> &mut T where F: FnOnce() -> T { + fn alloc_copy(&self, op: F) -> &mut T + where F: FnOnce() -> T + { unsafe { let ptr = self.alloc_copy_inner(mem::size_of::(), mem::align_of::()); let ptr = ptr as *mut T; @@ -296,7 +298,9 @@ impl<'longer_than_self> Arena<'longer_than_self> { } #[inline] - fn alloc_noncopy(&self, op: F) -> &mut T where F: FnOnce() -> T { + fn alloc_noncopy(&self, op: F) -> &mut T + where F: FnOnce() -> T + { unsafe { let tydesc = get_tydesc::(); let (ty_ptr, ptr) = self.alloc_noncopy_inner(mem::size_of::(), mem::align_of::()); @@ -318,7 +322,9 @@ impl<'longer_than_self> Arena<'longer_than_self> { /// Allocates a new item in the arena, using `op` to initialize the value, /// and returns a reference to it. #[inline] - pub fn alloc(&self, op: F) -> &mut T where F: FnOnce() -> T { + pub fn alloc(&self, op: F) -> &mut T + where F: FnOnce() -> T + { unsafe { if intrinsics::needs_drop::() { self.alloc_noncopy(op)