Should be possible with [`proc_macro_diagnostics`](https://github.com/rust-lang/rust/issues/54140)