proc-macro2 icon indicating copy to clipboard operation
proc-macro2 copied to clipboard

unsupported proc macro punctuation character '_' from v1.0.69 -> v1.0.89

Open Kreijstal opened this issue 1 year ago • 5 comments

I was trying to update this subdirectory https://github.com/pascalkuthe/OpenVAF/tree/master/sourcegen using cargo update... but for some reason what was allowed on 1.0.69 is now simply not allowed? I can't tell why it's detecting a rogue _. Is this a proc_macro2 bug?

Kreijstal avatar Oct 30 '24 18:10 Kreijstal

We've hit this in rust-analyzer as well where we were updating from 1.0.86 to latest (happened within a quote! invocation)

Veykril avatar Dec 20 '24 10:12 Veykril

We've hit this in rust-analyzer as well where we were updating from 1.0.86 to latest (happened within a quote! invocation)

It seems the bug gets in the way even on 1.0.69 to 1.0.70 weird!

Kreijstal avatar Dec 20 '24 12:12 Kreijstal

Seems to be due to a change made in this issue:

https://github.com/dtolnay/proc-macro2/issues/470

We are seeing the same issue with: '(' as well.

anjx123 avatar Feb 05 '25 05:02 anjx123

Ah, the comments in that thread explain things actually. _ is an identifier in the proc-macro API (and in rust in general I believe), so the error here is actually correct.

Veykril avatar Feb 05 '25 07:02 Veykril

@anjx123: c2rust had that issue too, but has since just moved away from single parentheses in https://github.com/immunant/c2rust/pull/1197. (I don't know proc macros well enough to have an opinion on whether proc-macro broke c2rust without a semver bump or whether c2rust did already hold it wrong, just observed that their code looked simpler after the fix.)

chrysn avatar Feb 21 '25 13:02 chrysn