-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Move cfg_if macro from libstd to libcore #57446
Comments
Unfortunately we don't have a great way to export a macro from libcore to use in libstd that isn't part of the public API. We aren't quite ready yet I think to make this part of the public API but duplicating the definition should be fine as its a pretty simple macro |
@alexcrichton 👍 Thanks for the info. I'll hold off on duplicating it in |
@alexcrichton can you elaborate on why we don't want to make |
More discussion about this is at #59443 as well. I do not personally have an opinion on whether or not this should be exported from |
I am going to close this issue as it's been somewhat obsoleted by the fact that libstd depends on cfg-if (the crate) now, and libcore can always duplicate if necessary. I imagine we might even be able to get libcore to depend on cfg-if (since it's a macro-only crate I believe), but that's likely harder :) |
Summary
If possible I would like to move the
cfg_if
macro fromsrc/libstd/macros.rs
tosrc/libcore/macros.rs
.Motivation
The
cfg_if
macro could potentially increase the readability of somecfg
s inno_std
code. In particular it could dramatically improve the readability of some code inlibcore
e.g.ffi::VaList
(why I'm interested in moving it 😄). I don't see anything in the macro that would make it invalid inlibcore
.The text was updated successfully, but these errors were encountered: