Cargo Features

[dependencies]
yaxpeax-arm = { version = "0.4.0", default-features = false, features = ["non-exhaustive-enums", "alloc", "fmt", "std", "use-serde"] }
default = alloc, fmt, non-exhaustive-enums, std, use-serde

These default features are set whenever yaxpeax-arm is added without default-features = false somewhere in the dependency tree.

non-exhaustive-enums default

IF YOU DISABLE DEFAULT FEATURES, EXPLICITLY ENABLE non-exhaustive-enums. unless you read the rest of this section and manage or tolerate additional Operand variants appearing across minor releases.

Opcode and Operand enums are marked non-exhaustive to tolerate future growth of the ISA or additions to the disassembler (NEON, etc). typically disassemblers either care about a specific subset of instructions (b<cc>, bl come to mind), or many (all?) instructions (program analysis, semantic lifting, ..).

this feature allows users to control the presence of the #[non_exhaustive] attribute on Opcode and Operand to get feedback on missing variants in large match blocks.

additions to Opcode and Operand will happen across minor version bumps, but not patch versions. code removing #[non_exhaustive] should probably lock to a minor versions.

this is an enabled-by-default feature to handle cases where a library removes this feature, but something else in the dependency tree enables it. this way, libraries can test with this feature disabled, lock to corresponding major.minor versions of the disassembler and opcode set, and then harmlessly tolerate #[non_exhaustive] if it's added inadvertently elsewhere in the dependency tree.

alloc default

fmt-related features that depend on the alloc crate. additionally, some supporting implementation comes from yaxpeax-arch's alloc feature.

Enables alloc of yaxpeax-arch

fmt default

formatting code (Display, Debug impls, etc) are (inconsistently) optional on fmt. future crate releases will move fmt impls consistently behind this feature.

some fmt code also has alloc features (InstructionDisplayBuffer)

Affects display::InstructionDisplayer

std default

opt-in for std-related Error impl - necessary to ?-unwrap DecodeError.

Enables std of yaxpeax-arch

use-serde default = serde, serde_derive

Enables use-serde of yaxpeax-arch

yaxpeax-arch:

enables the (optional) use of Serde for bounds on
Arch and Arch::Address

Affects a64::ARMv8

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features. These features may have been created by mistake, and this functionality may be removed in the future.

serde use-serde
serde_derive use-serde