diff --git a/schemars_derive/src/schema_exprs.rs b/schemars_derive/src/schema_exprs.rs index 976bbe04..3e1b4862 100644 --- a/schemars_derive/src/schema_exprs.rs +++ b/schemars_derive/src/schema_exprs.rs @@ -76,7 +76,12 @@ pub fn expr_for_repr(cont: &Container) -> Result { let variants = match &cont.data { Data::Enum(variants) => variants, - _ => return Err(syn::Error::new(Span::call_site(), "oh no!")), + _ => { + return Err(syn::Error::new( + Span::call_site(), + "JsonSchema_repr can only be used on enums", + )) + } }; if let Some(non_unit_error) = variants.iter().find_map(|v| match v.style {