-
Notifications
You must be signed in to change notification settings - Fork 1.6k
RFC: #[cfg(accessible(..) / version(..))] #2523
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
cc @MajorBreakfast re. use case for futures. :) |
Another point is that things that are gated sill need to use valid rust grammar. Let's assume that the version 1.42 adds support for throwing function, and using .if:
This won't compile in current rust, even after this rfc is implemented, because this is not valid grammar, and rustc still check the grammar of items even if they are going to be removed by attribute macro or cfg attribute. I suppose it would not make sense to relax the parsing rules of items that are disabled by #[cfg] So one must wrap the item inside a macro such as Btw, I've made a crate with a macro |
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. The RFC will be merged soon. |
🎉 Huzzah! This RFC has been merged! 🎉 Tracking issues: |
🖼️ Rendered
⏭ Tracking issue (
#[cfg(version(..))]
⏭ Tracking issue (
#[cfg(accessible(..))]
📝 Summary
Permit users to
#[cfg(..)]
on whether:#[cfg(version(1.27))]
).#[cfg(accessible(::std::mem::ManuallyDrop))]
).💖 Thanks
To @eddyb, @rpjohnst, @kennytm, @aturon, and @rkruppe for discussing the feature with me.
To @Mark-Simulacrum, @MajorBreakfast, @alexreg, @alercah, and @joshtriplett for reviewing the draft version of this RFC.