Skip to content

Commit fc44b5f

Browse files
committed
Upgrade rust toolchain
1 parent 9adc9ce commit fc44b5f

File tree

9 files changed

+12
-18
lines changed

9 files changed

+12
-18
lines changed

hoard/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
#![feature(thread_local)]
22
#![feature(step_trait)]
33
#![feature(allocator_api)]
4-
#![feature(const_mut_refs)]
54
#![feature(const_trait_impl)]
6-
#![feature(effects)]
75

86
extern crate mallockit;
97

hoard/src/pool.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ impl EmptyClass {
2424
}
2525
}
2626

27-
const fn group(block: SuperBlock) -> usize {
27+
fn group(block: SuperBlock) -> usize {
2828
let t =
2929
SuperBlock::DATA_BYTES >> block.size_class.log_bytes() << block.size_class.log_bytes();
3030
let u = block.used_bytes();

hoard/src/super_block.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,15 @@ impl SuperBlock {
6464
self.used_bytes = 0;
6565
}
6666

67-
pub const fn used_bytes(self) -> usize {
67+
pub fn used_bytes(self) -> usize {
6868
self.used_bytes as _
6969
}
7070

71-
pub const fn is_empty(self) -> bool {
71+
pub fn is_empty(self) -> bool {
7272
self.used_bytes == 0
7373
}
7474

75-
pub const fn is_full(self) -> bool {
75+
pub fn is_full(self) -> bool {
7676
self.bump_cursor >= Self::BYTES as u32 && self.head_cell.is_zero()
7777
}
7878

@@ -92,7 +92,7 @@ impl SuperBlock {
9292
Some(cell)
9393
}
9494

95-
pub const fn free_cell(&mut self, cell: Address) {
95+
pub fn free_cell(&mut self, cell: Address) {
9696
unsafe {
9797
cell.store(self.head_cell);
9898
}

mallockit/src/lib.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#![allow(incomplete_features)]
22
#![feature(const_trait_impl)]
3-
#![feature(const_mut_refs)]
43
#![feature(step_trait)]
54
#![feature(thread_local)]
65
#![feature(allocator_api)]
@@ -10,9 +9,6 @@
109
#![feature(adt_const_params)]
1110
#![feature(generic_const_exprs)]
1211
#![feature(effects)]
13-
#![feature(asm_const)]
14-
#![feature(const_refs_to_cell)]
15-
#![feature(const_refs_to_static)]
1612

1713
extern crate mallockit_macros;
1814
pub extern crate spin;

mallockit/src/space/page_resource/block_page_resource.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ impl<B: MemRegion> BlockPageResource<B> {
108108
}
109109
}
110110

111-
const fn set_next(b: B, next: Option<B>) {
111+
fn set_next(b: B, next: Option<B>) {
112112
let a = b.start();
113113
let next = match next {
114114
Some(b) => b.start(),
@@ -117,7 +117,7 @@ impl<B: MemRegion> BlockPageResource<B> {
117117
unsafe { a.store(next) }
118118
}
119119

120-
const fn get_next(b: B) -> Option<B> {
120+
fn get_next(b: B) -> Option<B> {
121121
let a = b.start();
122122
let next: Address = unsafe { a.load() };
123123
if next.is_zero() {

mallockit/src/util/malloc/macos_malloc_zone.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pub static mut MALLOCKIT_MALLOC_ZONE: MallocZone = MallocZone {
2020
batch_malloc: 0 as _,
2121
// Nullable
2222
batch_free: 0 as _,
23-
introspect: unsafe { addr_of!(MALLOCKIT_MALLOC_INTROSPECTION) },
23+
introspect: addr_of!(MALLOCKIT_MALLOC_INTROSPECTION),
2424
version: 9,
2525
memalign: zone_memalign,
2626
free_definite_size: 0 as _,

mallockit/src/util/mem/heap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ impl Heap {
2424
}
2525

2626
pub const fn contains(&self, ptr: Address) -> bool {
27-
self.start <= ptr && ptr < self.end
27+
self.start.as_usize() <= ptr.as_usize() && ptr.as_usize() < self.end.as_usize()
2828
}
2929

3030
pub const fn start(&self) -> Address {

mallockit/src/util/sys/hooks.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
use std::panic::PanicInfo;
1+
use std::panic::PanicHookInfo;
22

33
use crate::Plan;
44

5-
fn panic_handler(panic_info: &PanicInfo<'_>) {
5+
fn panic_handler(panic_info: &PanicHookInfo<'_>) {
66
crate::println!("{}", panic_info);
77
std::process::abort();
88
}

rust-toolchain

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
nightly-2024-05-01
1+
nightly-2024-11-01

0 commit comments

Comments
 (0)