From 21f1b7decf5dd668975f263d9a07ae345f7e6556 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Mon, 5 Jan 2026 15:23:44 -0800 Subject: [PATCH 1/3] Make the `std` feature inert In more recent versions of Rust the `Error` trait no longer needs to be gated, so use it through `core::error::Error` to remove the only usage of the `feature = "std"` directive. The `std` feature is left for now to avoid breaking downstream users (if any applicable) but should be removable later. --- Cargo.toml | 3 ++- src/lib.rs | 6 +----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 010f8c03..5ed9c89d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,7 +40,8 @@ overflow-checks = true [features] default = ["std"] -# Enables std-specific features such as the Error trait for RegAllocError. +# Currently does nothing, but historically enabled some `std` features such as +# the `Error` trait. std = [] # Enables generation of DefAlloc edits for the checker. diff --git a/src/lib.rs b/src/lib.rs index 1f2d3276..1be7555d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -14,9 +14,6 @@ #![allow(clippy::all)] #![no_std] -#[cfg(feature = "std")] -extern crate std; - extern crate alloc; // Even when trace logging is disabled, the trace macro has a significant @@ -1627,8 +1624,7 @@ impl core::fmt::Display for RegAllocError { } } -#[cfg(feature = "std")] -impl std::error::Error for RegAllocError {} +impl core::error::Error for RegAllocError {} /// Run the allocator. pub fn run( From 37f6b0281310d3cf3b46ffb278ce8db4afbe5323 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Mon, 5 Jan 2026 15:34:37 -0800 Subject: [PATCH 2/3] Fix fuzzing build --- src/lib.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 1be7555d..30a4bcc8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -14,6 +14,9 @@ #![allow(clippy::all)] #![no_std] +#[cfg(feature = "fuzzing")] +extern crate std; + extern crate alloc; // Even when trace logging is disabled, the trace macro has a significant From c88d09d7f1b243115f93cc5950fbd991efd81ed1 Mon Sep 17 00:00:00 2001 From: Chris Fallin Date: Tue, 6 Jan 2026 05:55:12 -0800 Subject: [PATCH 3/3] Fix cargo-deny CI job --- .github/workflows/rust.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 13498626..b9f8c519 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -56,11 +56,7 @@ jobs: - uses: actions/checkout@v3 with: submodules: true - - run: | - set -e - curl -L https://github.com/EmbarkStudios/cargo-deny/releases/download/0.14.22/cargo-deny-0.14.22-x86_64-unknown-linux-musl.tar.gz | tar xzf - - mv cargo-deny-*-x86_64-unknown-linux-musl/cargo-deny cargo-deny - echo `pwd` >> $GITHUB_PATH + - run: cargo install cargo-deny - run: cargo deny check # Builds the fuzz targets.