Skip to content

Commit e15c62d

Browse files
committed
revert making internal APIs const fn.
1 parent d1d2aa2 commit e15c62d

File tree

28 files changed

+47
-47
lines changed

28 files changed

+47
-47
lines changed

src/liballoc/collections/binary_heap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -884,7 +884,7 @@ impl<'a, T> Hole<'a, T> {
884884
}
885885

886886
#[inline]
887-
const fn pos(&self) -> usize {
887+
fn pos(&self) -> usize {
888888
self.pos
889889
}
890890

src/liballoc/collections/btree/node.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ impl<BorrowType, K, V, Type> NodeRef<BorrowType, K, V, Type> {
357357

358358
/// Returns the height of this node in the whole tree. Zero height denotes the
359359
/// leaf level.
360-
pub const fn height(&self) -> usize {
360+
pub fn height(&self) -> usize {
361361
self.height
362362
}
363363

src/liballoc/collections/linked_list.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ impl<T: fmt::Debug> fmt::Debug for IntoIter<T> {
135135
}
136136

137137
impl<T> Node<T> {
138-
const fn new(element: T) -> Self {
138+
fn new(element: T) -> Self {
139139
Node {
140140
next: None,
141141
prev: None,

src/liballoc/collections/vec_deque.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1275,7 +1275,7 @@ impl<T> VecDeque<T> {
12751275
}
12761276

12771277
#[inline]
1278-
const fn is_contiguous(&self) -> bool {
1278+
fn is_contiguous(&self) -> bool {
12791279
self.tail <= self.head
12801280
}
12811281

src/liballoc/raw_vec.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ impl<T, A: Alloc> RawVec<T, A> {
204204
/// Gets a raw pointer to the start of the allocation. Note that this is
205205
/// Unique::empty() if `cap = 0` or T is zero-sized. In the former case, you must
206206
/// be careful.
207-
pub const fn ptr(&self) -> *mut T {
207+
pub fn ptr(&self) -> *mut T {
208208
self.ptr.as_ptr()
209209
}
210210

@@ -221,7 +221,7 @@ impl<T, A: Alloc> RawVec<T, A> {
221221
}
222222

223223
/// Returns a shared reference to the allocator backing this RawVec.
224-
pub const fn alloc(&self) -> &A {
224+
pub fn alloc(&self) -> &A {
225225
&self.a
226226
}
227227

src/libcore/alloc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use num::NonZeroUsize;
2525
#[derive(Debug)]
2626
pub struct Excess(pub NonNull<u8>, pub usize);
2727

28-
const fn size_align<T>() -> (usize, usize) {
28+
fn size_align<T>() -> (usize, usize) {
2929
(mem::size_of::<T>(), mem::align_of::<T>())
3030
}
3131

src/libcore/array.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ impl TryFromSliceError {
7777
issue = "0")]
7878
#[inline]
7979
#[doc(hidden)]
80-
pub const fn __description(&self) -> &str {
80+
pub fn __description(&self) -> &str {
8181
"could not convert slice to array"
8282
}
8383
}

src/libcore/benches/iter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ fn bench_multiple_take(b: &mut Bencher) {
3939
});
4040
}
4141

42-
const fn scatter(x: i32) -> i32 { (x * 31) % 127 }
42+
fn scatter(x: i32) -> i32 { (x * 31) % 127 }
4343

4444
#[bench]
4545
fn bench_max_by_key(b: &mut Bencher) {

src/libcore/cell.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -636,12 +636,12 @@ type BorrowFlag = isize;
636636
const UNUSED: BorrowFlag = 0;
637637

638638
#[inline(always)]
639-
const fn is_writing(x: BorrowFlag) -> bool {
639+
fn is_writing(x: BorrowFlag) -> bool {
640640
x < UNUSED
641641
}
642642

643643
#[inline(always)]
644-
const fn is_reading(x: BorrowFlag) -> bool {
644+
fn is_reading(x: BorrowFlag) -> bool {
645645
x > UNUSED
646646
}
647647

src/libcore/fmt/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1703,11 +1703,11 @@ impl<'a> Formatter<'a> {
17031703

17041704
// FIXME: Decide what public API we want for these two flags.
17051705
// https://github.com/rust-lang/rust/issues/48584
1706-
const fn debug_lower_hex(&self) -> bool {
1706+
fn debug_lower_hex(&self) -> bool {
17071707
self.flags & (1 << FlagV1::DebugLowerHex as u32) != 0
17081708
}
17091709

1710-
const fn debug_upper_hex(&self) -> bool {
1710+
fn debug_upper_hex(&self) -> bool {
17111711
self.flags & (1 << FlagV1::DebugUpperHex as u32) != 0
17121712
}
17131713

0 commit comments

Comments
 (0)