Re: [PATCH] rust: proc-macro2: enable `proc_macro_span` feature
From: Miguel Ojeda
Date: Mon Sep 28 2026 - 09:15:43 EST
On Mon, Sep 28, 2026 at 1:28 PM Gary Guo <gary@xxxxxxxxxxx> wrote:
>
> Another thing is that pin-init's diagnostics test suite is built with Cargo,
> and the build script of proc-macro2 will probe if the nightly feature is
> available and enable proc_macro_span automatically. So if this is not enabled on
> RfL side, the diagnostics can diverge from what we expect.
Doesn't sound fun...
> I think the self-ref one is the main motivating factor, because the diagnostics
> with that can be confusing in general. That said, I have improved it much over
> the last week, it seems that it is not *that* needed anymore.
Yeah, that one looks more important to have indeed.
> So, none of these are really big deals and that can be said to diagnostics in
> general. But I think the change needed here is small enough that any improvement
> can be used to justify that. I also submitted the proc-macro2 change upstream
> too: https://github.com/dtolnay/proc-macro2/pull/542; if that is merged and we
> later update proc-macro2, we should get down to just a single Makefile line
> change.
Ok, in that case (plus what you mention above and the examples --
thanks for those, by the way), I think it is fine either way.
I added it preemptively to the "nice to have" section in #2:
https://github.com/Rust-for-Linux/linux/issues/2
Cheers,
Miguel