diff --git a/Cargo.toml b/Cargo.toml index e53f476..b9a7b63 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,7 +26,7 @@ default = ["std", "full-decoder", "formatter"] alloc = [] std = ["alloc"] full-decoder = [] -formatter = ["std", "full-decoder"] +formatter = ["alloc", "full-decoder"] encoder = ["alloc", "full-decoder"] serialization = ["serde", "bitflags/serde"] nolibc = [] diff --git a/src/encoder.rs b/src/encoder.rs index 7ce1e09..bb1ae2a 100644 --- a/src/encoder.rs +++ b/src/encoder.rs @@ -719,6 +719,7 @@ macro_rules! insn32 { #[cfg(all(test, feature = "formatter"))] mod tests { use super::*; + use alloc::string::ToString as _; #[test] fn insn_macro() { diff --git a/src/formatter.rs b/src/formatter.rs index 1eb76d7..8c93437 100644 --- a/src/formatter.rs +++ b/src/formatter.rs @@ -1,9 +1,10 @@ //! Textual instruction formatting routines. +use alloc::{borrow::ToOwned, boxed::Box, string::String}; use core::{ + ffi::{c_void, CStr}, fmt, mem::{self, MaybeUninit}, - ffi::{c_void, CStr}, ptr, };