From 75c4d44f336e20cfc544f5046ed62bfebcb95a92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joel=20H=C3=B6ner?= Date: Sat, 9 Mar 2024 17:35:51 +0100 Subject: [PATCH] Also use `alloc` feature in `formatter` --- Cargo.toml | 2 +- src/encoder.rs | 1 + src/formatter.rs | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) 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, };