Use proc_macro::Diagnostic instead of panic! in a few places

Thanks to Antoni Boucher for the tips.
parent ffaeacbd
Pipeline #9059 passed with stages
in 8 minutes and 42 seconds