Repository navigation
Put the Allocator impls behind allocator-api and lower the MSRV to 1.88 - #3
Merged
Merged
Conversation
The standard library's Allocator trait became stable in Rust 1.100, which set the crate's minimum version. Its implementations for Bcmalloc and Heap now live in the allocator module, compiled only with the new allocator-api feature, and the rest of the library builds on Rust 1.88, where let chains and const Cell::get became stable. The testing helper that zeroes slices allocates them with alloc_zeroed instead of Box::new_zeroed_slice (1.92). The library declares rust-version 1.88; the internal crates keep the workspace's 1.100. just msrv checks every feature combination but allocator-api on the declared version through cargo-hack, which installs the toolchain, and CI runs it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The standard library's
Allocatortrait became stable in Rust 1.100, and that set the crate's minimum Rust version. This PR moves the trait behind a feature, so the rest of the library builds on older compilers.allocator-apifeature. TheAllocatorimplementations forBcmallocandHeap, with theirBackendplumbing, move intosrc/allocator.rs. That module compiles only with the new feature, which is off by default. Clippy'sincompatible_msrvlint is allowed in that module, with a reason.bcmallocdeclaresrust-version = "1.88". The older toolchains failed on let chains and on constCell::get, both stable since 1.88. The internal crates (C library, benchmarks, bench data) keep the workspace's 1.100.testinghelper. The helper that zeroes slices usedBox::new_zeroed_slice, which needs 1.92. It now allocates withalloc_zeroedand hands the memory toBox::from_raw.Bcmallocexamples use hidden#[cfg]lines. Theflush_threadtest now allocates throughGlobalAlloc, so it runs without the feature. The README badge and the Limits section give 1.88, and say thatallocator-apineeds 1.100.just msrvand CI. The new recipe runscargo hack --feature-powerset --exclude-features allocator-api --rust-version check --lib, which installs the 1.88 toolchain if it is missing. CI runs it as a new "Minimum Rust version" job.Breaking: code that used
Vec::new_in(&allocator)orBox::new_inwith bcmalloc needsfeatures = ["allocator-api"].Checks run locally:
just lint,just lint-docs,just hack(now 20 combinations), andjust msrvon 1.88 (10 combinations).