Cargo Features

[dependencies]
memchr = { version = "2.8.1", default-features = false, features = ["std", "alloc", "logging", "use_std", "libc", "rustc-dep-of-std"] }
default = std

The std feature is set by default whenever memchr is added without default-features = false somewhere in the dependency tree.

std default use_std? = alloc

The 'std' feature permits the memchr crate to use the standard library. This permits this crate to use runtime CPU feature detection to automatically accelerate searching via vector instructions. Without the standard library,
this automatic detection is not possible.

alloc std

The 'alloc' feature enables some APIs that require allocation, such as 'Finder::into_owned'. Note that this feature does not enable runtime CPU
feature detection. That still requires 'std'.

Affects all::shiftor

logging

When enabled (it's disabled by default), the log crate will be used to emit a spattering of log messages. For the most part, the log messages are meant to indicate what strategies are being employed. For example, whether a vector or a scalar algorithm is used for substring search. This can be useful when debugging performance problems.

This is disabled by default.

Enables log

Only used when the logging feature is enabled (disabled by default).

use_std = std

The 'use_std' feature is DEPRECATED. It will be removed in memchr 3. Until then, it is alias for the 'std' feature.

libc

The 'libc' feature has been DEPRECATED and no longer has any effect.

rustc-dep-of-std = core

Internal feature, only used when building as part of libstd, not part of the stable interface of this crate.

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.

core rustc-dep-of-std?

Enables rustc-std-workspace-core

Internal feature, only used when building as part of libstd, not part of the stable interface of this crate.