diff --git a/crates/relax-macros/src/lib.rs b/crates/relax-macros/src/lib.rs index 7ab1639..079a3b1 100644 --- a/crates/relax-macros/src/lib.rs +++ b/crates/relax-macros/src/lib.rs @@ -4,7 +4,10 @@ use syn::{parse_macro_input, spanned::Spanned}; #[proc_macro_derive(Relax, attributes(relax))] pub fn derive(input: proc_macro::TokenStream) -> proc_macro::TokenStream { - derive_impl(parse_macro_input!(input)).unwrap().into() + match derive_impl(parse_macro_input!(input)) { + Ok(tokens) => tokens.into(), + Err(error) => error.to_compile_error().into(), + } } fn derive_impl(input: syn::DeriveInput) -> syn::Result {