Skip to main content

crate_config

Function crate_config 

Source
pub(crate) fn crate_config() -> Result<CrateConfig, CrateConfigError>
Expand description

The crate config for the crate currently being compiled.

Returns the defaults when CARGO_MANIFEST_DIR is unset or its Cargo.toml cannot be read; only a present-but-malformed entry is an error. Results are cached per manifest directory, so a single proc-macro server process serving several crates (rust-analyzer) never leaks one crate’s default into another.