> >+                quote! {
> >+                    {
> >+                        const {
> >+                            assert!(#bitval >= 0 && #bitval < 
> >#field_ty::BITS as _,
> >+                                    "bit number exceeds type bits 
> >range");
> 
> Const panic messages cannot use formatting parameters yet, but.
> Can we interpolate the type (e.g u32) in the compile-time panic message? 

Good idea! `concat!` with `stringify!(#field_ty)` should work.

> Not important but would make the error message friendlier.

Yeah, let me refresh a v3.

> Reviewed-by: Manos Pitsidianakis <[email protected]>

Thanks!

Regards,
Zhao

Reply via email to