-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
proc-macro2@1.0.56
breaks quote!
line formatting
#39
Comments
Thanks for the report! This is due to dtolnay/proc-macro2#383 which is in preparation of a maybe breaking nightly upcoming change. Seems like things are gonna be broken for a while. Welcome to nightly :) |
I locked to an older |
Hm... maybe. It's going to instantly break if / once that nightly change lands, so I'm not sure there's a ton of benefit to be had by making a release right now. I'll have to do one anyway once the new API is available. I'll think about it. |
We might also soon see stable support for line/column information, meaning the years long wait would be over 🎉 |
Well, difficult for me to weigh in, because I don't have a good grasp on the timescales involved. Thanks for the explanation though. |
proc-macro2 breaks genco (see udoprog/genco#39). For now, we can introduce a version cap like this, so that it works even when someone installs without `--locked`.
proc-macro2 breaks genco (see udoprog/genco#39). For now, we can introduce a version cap like this, so that it works even when someone installs without `--locked`.
I'll bake a new release if rust-lang/rust#111571 is not out on nightly within the week. Sorry for the inconvenience. Keeping this open to track the issue. |
Not a problem and thanks for the quick responses! |
Also affected by this. Can't pin |
All right. Time to start building a workaround, we'll have to bypass |
@kklas I'm curious; Which other dependency? |
I'm building a code generator tool against https://github.com/MystenLabs/sui. It's a huge repo pulling in a lot of transitive dependencies. This is what I get trying to pin
Even if I could fix this (which I can't) there would probably be others. |
Ah, definitely not, it's I don't think there's a way for me to fix this other than wait for a new nightly and proc-macro2 to update. There's no APIs to access the underlying Span and proc-macro2 is a deep dependency for all macro processing (parsing in |
Ok, thanks for taking a look. I will work around it in the meantime by throwing a formatter at it after the code is generated. I hope these APIs you need land in stable soon so we don't have to use nightly. |
Me too, especially since I no longer can use nightly! |
Signed-off-by: kjuulh <contact@kjuulh.io>
* Fix Rust SDK errors They started happening right after #5372 got merged, even though this commit didn't change anything in the Rust SDK. Updating all dependencies to latest via `cargo update` & re-running the Rust SDK codegen (which seems to create incorrect comments) fixed the issue for both lint & test. Signed-off-by: Gerhard Lazu <gerhard@dagger.io> * feat: temporary fix waiting for: udoprog/genco/issues/39 Signed-off-by: kjuulh <contact@kjuulh.io> * feat: with stable version Signed-off-by: kjuulh <contact@kjuulh.io> * feat: with common variables Signed-off-by: kjuulh <contact@kjuulh.io> * feat: with rustfmt in base image Signed-off-by: kjuulh <contact@kjuulh.io> --------- Signed-off-by: Gerhard Lazu <gerhard@dagger.io> Signed-off-by: kjuulh <contact@kjuulh.io> Co-authored-by: kjuulh <contact@kjuulh.io>
Since this has delayed for so long, a nightly only workaround is now available. By adding the following patches: [patch.crates-io]
genco = { git = "https://github.com/udoprog/genco", branch = "proc-macro2-fork" }
proc-macro2 = { git = "https://github.com/udoprog/proc-macro2", branch = "span-locations" } |
Unfortunately, this does not seem to work. I do:
then in [dependencies]
genco = { git = "https://github.com/udoprog/genco", branch = "proc-macro2-fork" }
[patch.crates-io]
proc-macro2 = { git = "https://github.com/udoprog/proc-macro2", branch = "span-locations" } then
and some more errors. Edit: same with proc-macro2 = { git = "https://github.com/hydro-project/proc-macro2", branch = "new-span-locs" } which is the actual version currently set in the genco repo. |
Hi, I can confirm this works, so thanks for the fix! However, it seems a sufficiently-recent nightly is needed? I set |
Hm, since there's no nightly-specific rust version I can set in Cargo.toml I'm a bit hesitant to pin the project on stable to that MSRV. Besides, the feature might change in a future nightly again, so that declaration would not be accurate. For now I'd recommend the latest nightly until its stabilized. It might however be worth noting somewhere in the README that it requires at least a a 1.73 nightly or beyond. That's where I think the feature was changed with Thanks for pointing this out to me! It's well worth considering. |
It seems that upgrading to
proc-macro2 >=1.0.56
breaks how newlines are handled in the generated code.Steps to reproduce:
cargo update -p proc-macro2 --precise 1.0.56
cargo test
Note that it seems to work correctly for
1.0.55
.The text was updated successfully, but these errors were encountered: