Registry / build-tool / proc-macro-crate

proc-macro-crate

JSON →
library3.5.0rscratesunverified

Replacement for the `crate` keyword in proc-macros, enabling access to the calling crate's items.

# Cargo.toml [dependencies] proc-macro-crate = "3.5.0"
INSTALL
IMPORT
SIG · PROC-MACRO-CRATE
P
proc-macro-crate
build-toolrustv3.5.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

crate_name
use proc_macro_crate::crate_name;

Get the name of the crate where the proc-macro is invoked.

use proc_macro_crate::crate_name; let name = crate_name().unwrap(); println!("Crate name: {}", name);
Debug
Known issues

No known issues recorded.

Upgrade
Version history
3.5.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
20 hits · last 30 days
node
18
OpenAI (training)
1
Resources
proc-macro-crate — cargo add proc-macro-crate · libregistry