Registry / build-tool / proc-macro-error

proc-macro-error

JSON →
library1.0.4rscratesunverified

Almost drop-in replacement to panics in proc-macros

# Cargo.toml [dependencies] proc-macro-error = "1.0.4"
INSTALL
IMPORT
SIG · PROC-MACRO-ERROR
P
proc-macro-error
build-toolrustv1.0.4
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.

abort
use proc_macro_error::abort;

Emit a compile-time error from a procedural macro.

use proc_macro::TokenStream; use proc_macro_error::proc_macro_error; #[proc_macro_error] #[proc_macro] pub fn my_macro(_input: TokenStream) -> TokenStream { abort!(span, "This macro is not implemented yet"); }
Debug
Known issues
breakingThis crate is deprecated in favor of using `proc_macro::Diagnostic` directly.
fix
Migrate to `proc_macro::Diagnostic` if using nightly Rust.
affects: >=1.0.0
Upgrade
Version history
1.0.4latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

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