diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index f89e838..5c0627c 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -24,5 +24,7 @@ jobs: run: cargo build --verbose - name: Build without default features run: cargo build --no-default-features --verbose + - name: Build with all features + run: cargo build --all-features --verbose - name: Run tests run: cargo test --verbose diff --git a/Cargo.toml b/Cargo.toml index 9687ee1..958fe18 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,6 @@ license = "MIT" [features] default = ["alloc", "use_spin"] alloc = [] -const_fn = [] use_spin = ["spin"] [dependencies.spin] diff --git a/README.md b/README.md index 2dea836..98fa6b4 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,6 @@ You can also use `FrameAllocator` and `LockedHeapWithRescue`, see their document global allocator. - **`use_spin`** (default): Provide a `LockedHeap` type that implements the [`GlobalAlloc`] trait by using a spinlock. -- **`const_fn`** (nightly only): Provide const fn version of `LockedHeapWithRescue::new`. [`GlobalAlloc`]: https://doc.rust-lang.org/nightly/core/alloc/trait.GlobalAlloc.html diff --git a/src/lib.rs b/src/lib.rs index ff12a9d..e42887e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,4 +1,3 @@ -#![cfg_attr(feature = "const_fn", feature(const_mut_refs, const_fn_fn_ptr_basics))] #![no_std] #[cfg(test)] @@ -293,22 +292,12 @@ pub struct LockedHeapWithRescue { #[cfg(feature = "use_spin")] impl LockedHeapWithRescue { /// Creates an empty heap - #[cfg(feature = "const_fn")] pub const fn new(rescue: fn(&mut Heap, &Layout)) -> Self { LockedHeapWithRescue { inner: Mutex::new(Heap::::new()), rescue, } } - - /// Creates an empty heap - #[cfg(not(feature = "const_fn"))] - pub fn new(rescue: fn(&mut Heap, &Layout)) -> Self { - LockedHeapWithRescue { - inner: Mutex::new(Heap::::new()), - rescue, - } - } } #[cfg(feature = "use_spin")]