-
Notifications
You must be signed in to change notification settings - Fork 10
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
Deprecated - please migrate to the paste crate #45
Comments
This is fantastic news! Based on your recent experience, are you confident that As far as reaching current users of this crate, it's probably easiest (even if it's not elegant) to deprecate and let users figure out the path appropriate from there. Perhaps we'll discover Let me know what your thoughts are on the technical consequences of deprecation. I'm in favor of deprecation if you think the majority of current use cases can be solved with Thanks for bringing this to my attention and for your continuing work. |
@dtolnay replaced almost all usages of There are a couple of crates in crates.io currently depending on Maybe it would be good if they could try migrating their own crates to |
I've updated the README with 4685d79. Feel free to modify the text if it's not entirely conveying of the situation. I agree, let's hold off on full deprecation for a bit until we hear some thoughts from |
@gnzlbg Thanks for letting me know about this! Using I've published a new version of my crate, so I'm no longer depending on |
Where is it used in statement position? Can you adjust the code to use it in item position instead? |
I tried that by changing: ($fn:ident, $prefix:ident $(, $arg:tt)*) => (
paste::item! {
call_macro!($fn,
([<$prefix _0001_byte>], $crate::types::Byte1 $(,$arg)*),
([<$prefix _0002_byte>], $crate::types::Byte2 $(,$arg)*), to this: ($fn:ident, $prefix:ident $(, $arg:tt)*) => (
call_macro!($fn,
(paste::item! { [<$prefix _0001_byte>] }, $crate::types::Byte1 $(,$arg)*),
(paste::item! { [<$prefix _0002_byte>] }, $crate::types::Byte2 $(,$arg)*), Unfortunately, that caused other errors:
|
I think you are looking at the wrong line -- the line you linked to is only evaluated in statement position if call_for_all_types_prefix is invoked in statement position. So you need to look at invocations of call_for_all_types_prefix rather than that line. I would think all invocations of call_for_all_types_prefix would be in item position because it seems designed to generate test functions, and test functions aren't supported within a function body i.e. all of that code is only useful if invoked in item position. |
Ah, looks like you're right; I was calling it from However, now I run into this problem:
|
That looks like rust-lang/rust#55640. For now it should be okay to replace |
OK looks like, with that temporary fix in place, everything works for us! |
Going through the reverse dependencies on crates.io, the following still depend on interpolate idents:
There is a PR with a fix for |
So That means that only two crates will depend on interpolate idents for the reasonable future |
The interpolate_idents dependency was removed from |
The readme of So it will probably not need to worry about any of this since it is requiring a fixed version of So I guess this is it ? All crates appear to have upgraded to |
Here's another list to push on if you feel like it: |
cc the following github-repositories use interpolate idents but are not released on crates.io: @sdleffler/knoll-rs, @efyang/xiami-api-rs, @rust-av/flv-demuxer-test, @zolkko/pug-rust, @Oipo/nanogui-rust-sdl, @expobrain/ryaml, @majorz/parallax, @majorz/apache2-rs, @snim2/testglobsoquestion, @Gen-OS/bbb-proof-of-concept, @code-ape/rust_python_extension, @dai1975/fiatproof, |
Just saw this issue - my use case is generating function names for tests, so Paste is a perfectly fine replacement. Thanks for the tag 👍 |
@SkylerLipthay so interpolate_idents broke again, this time forever. Could you disable the travis cron job for regularly testing the crate ? It's time to pull the plug! |
🎊 🎉 Thanks for all of your attention during this process @gnzlbg, it's been a pleasure! |
I don't really know how to easily reach those using
interpolate_idents
, but @dtolnay recently publishedpaste
: a crate that does the same thing thatinterpolate_idents
does but uses a procedural macro and works in stable Rust 1.30.0 and up. That is, no more breakage due to rustc changes.The syntax to use it is slightly different:
paste
uses[<
and>]
as delimiters instead of just[
and]
, which means that one does not need to write[[
]]
anymore when indexing arrays. We have been happily using it inpacked_simd
for a week.While
interpolate_idents
has served us very well for a very long time, maybe it is time to deprecate it. We could change the readme to point to thepaste
crate and upload one last version tocrates.io
to show this there as well. The next time the crate breaks, we could just leave it broken, and tell people to migrate.An alternative would be to maybe the next time something breaks, just re-export the
paste
crate from interpolate-idents or something like that. But I don't think it is worth maintaining two crates here.The text was updated successfully, but these errors were encountered: