| Crates.io | vacro-report |
| lib.rs | vacro-report |
| version | 0.1.2 |
| created_at | 2025-12-29 06:24:15.632911+00 |
| updated_at | 2026-01-06 14:46:06.980573+00 |
| description | Diagnostic reporting enhancements for Rust procedural macros, improving error messages. |
| homepage | |
| repository | https://github.com/FeVeR-Store/vacro |
| max_upload_size | |
| id | 2010045 |
| size | 27,493 |
Better Panic Reporting for Procedural Macros
vacro-report is a diagnostic enhancement tool designed to improve the debugging experience for Rust Procedural Macros.
It currently focuses on solving the opaque panic messages generated by syn::parse_quote! or parse_quote_spanned. When parse_quote! or parse_quote_spanned fails, it usually just says "failed to parse". vacro-report intercepts these calls and prints the actual generated token stream formatted as code, highlighting the syntax error.
[dependencies]
vacro-report = "0.1.2"
Simply decorate your function with #[vacro_report::scope].
Inside the scope, any usage of parse_quote! and parse_quote_spanned will be automatically instrumented. No other code changes are required.
use syn::{parse_quote, Expr, Token};
use vacro_report::scope;
#[scope]
fn generate_code() {
// If this fails, vacro-report will print the exact tokens that caused the error.
let _expr: Expr = parse_quote! {
1 + 2 + // Missing operand, would normally panic silently or vaguely
};
}
parse_quote! and parse_quote_spanned! calls within the #[scope] function.⚠️ Warning
We use
debug_assertionsto make this judgment, which means that if you have enabled certain optimizations, the effect may not trigger.