From e15c62d61fa02fac93992db9297aa4a8a56cef93 Mon Sep 17 00:00:00 2001 From: Mazdak Farrokhzad Date: Tue, 23 Oct 2018 23:09:44 +0200 Subject: revert making internal APIs const fn. --- src/liballoc/collections/binary_heap.rs | 2 +- src/liballoc/collections/btree/node.rs | 2 +- src/liballoc/collections/linked_list.rs | 2 +- src/liballoc/collections/vec_deque.rs | 2 +- src/liballoc/raw_vec.rs | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/liballoc') diff --git a/src/liballoc/collections/binary_heap.rs b/src/liballoc/collections/binary_heap.rs index e7e741dea4c..fcadcb544c4 100644 --- a/src/liballoc/collections/binary_heap.rs +++ b/src/liballoc/collections/binary_heap.rs @@ -884,7 +884,7 @@ impl<'a, T> Hole<'a, T> { } #[inline] - const fn pos(&self) -> usize { + fn pos(&self) -> usize { self.pos } diff --git a/src/liballoc/collections/btree/node.rs b/src/liballoc/collections/btree/node.rs index 10665b8e463..deca9591fbd 100644 --- a/src/liballoc/collections/btree/node.rs +++ b/src/liballoc/collections/btree/node.rs @@ -357,7 +357,7 @@ impl NodeRef { /// Returns the height of this node in the whole tree. Zero height denotes the /// leaf level. - pub const fn height(&self) -> usize { + pub fn height(&self) -> usize { self.height } diff --git a/src/liballoc/collections/linked_list.rs b/src/liballoc/collections/linked_list.rs index 9b2975b81a3..3d66b9f54da 100644 --- a/src/liballoc/collections/linked_list.rs +++ b/src/liballoc/collections/linked_list.rs @@ -135,7 +135,7 @@ impl fmt::Debug for IntoIter { } impl Node { - const fn new(element: T) -> Self { + fn new(element: T) -> Self { Node { next: None, prev: None, diff --git a/src/liballoc/collections/vec_deque.rs b/src/liballoc/collections/vec_deque.rs index e0ae7561d45..88e76033f27 100644 --- a/src/liballoc/collections/vec_deque.rs +++ b/src/liballoc/collections/vec_deque.rs @@ -1275,7 +1275,7 @@ impl VecDeque { } #[inline] - const fn is_contiguous(&self) -> bool { + fn is_contiguous(&self) -> bool { self.tail <= self.head } diff --git a/src/liballoc/raw_vec.rs b/src/liballoc/raw_vec.rs index 0b6f400a403..837770feece 100644 --- a/src/liballoc/raw_vec.rs +++ b/src/liballoc/raw_vec.rs @@ -204,7 +204,7 @@ impl RawVec { /// Gets a raw pointer to the start of the allocation. Note that this is /// Unique::empty() if `cap = 0` or T is zero-sized. In the former case, you must /// be careful. - pub const fn ptr(&self) -> *mut T { + pub fn ptr(&self) -> *mut T { self.ptr.as_ptr() } @@ -221,7 +221,7 @@ impl RawVec { } /// Returns a shared reference to the allocator backing this RawVec. - pub const fn alloc(&self) -> &A { + pub fn alloc(&self) -> &A { &self.a } -- cgit 1.4.1-3-g733a5