Cargo Features

anchor-lang has no features set by default.

[dependencies]
anchor-lang = { version = "0.30.1", features = ["allow-missing-optionals", "anchor-debug", "derive", "event-cpi", "idl-build", "init-if-needed", "interface-instructions"] }
allow-missing-optionals

Enables allow-missing-optionals of anchor-derive-accounts

anchor-debug

Enables anchor-debug of anchor-attribute-access-control, anchor-attribute-account, anchor-attribute-constant, anchor-attribute-error, anchor-attribute-event, anchor-attribute-program, and anchor-derive-accounts

derive
event-cpi

Enables event-cpi of anchor-attribute-event

idl-build

Enables idl-build of anchor-attribute-account, anchor-attribute-constant, anchor-attribute-error, anchor-attribute-event, anchor-attribute-program, anchor-derive-accounts, and anchor-derive-serde and build of anchor-lang-idl

anchor-lang-idl should only be included with idl-build feature

init-if-needed

Enables init-if-needed of anchor-derive-accounts

interface-instructions

Enables interface-instructions of anchor-attribute-program

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.

anchor-lang-idl idl-build?