-
Notifications
You must be signed in to change notification settings - Fork 19
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
export core::cfg_if #479
Comments
This is more libs than libs-api as there's no reason for this to ever be stabilized. Tbh I do think it better to move to |
Tbh I only found out about the existance of still, even if it was stuck behind a perma-unstable attribute, this would basically give a free speedup to the process of building the standard library, which could reduce CI load a bit. |
even if is there anything |
This isn't a good argument. Following it would mean we'd import all of crates.io into std. |
The difference is I feel like I layed it out all the reasons this "put this in stdlib" request is different from most.
I mean, the main advantage is |
We could just copy/paste the Tbh, I'm not really sure if one small dependency in amongst many has that big an impact. If you don't have cargo you still have to have some way to compile std's other dependencies, no? And these dependencies are not stable. They can change depending on platform and over time. |
Are you missing the part where It's not about it being a huge improvement, it's about it having basically no downside as far as I can see. the only code that needs to be added is two attributes ( |
No, core pastes it into it's own macro file. I was suggesting putting it somewhere both core and std can depend on it independently. That would avoid the need to add an API.
If we did it this way, I'd also prefer to make it |
yeah that's fine, most perma-unstable things are. |
I guess I'm very confused by this being an API Change Proposal |
my original intent was that it should be stabilized eventually, but you quickly convinced me it would be better off perma-unstable. |
+1 for converting to |
if this thing is going to be perma-unstable plus that said i'd prefer migrating all 80 instances of |
We already have |
Proposal
Problem statement
cfg-if
is one of the most widely used macro crates. it is as ubiquitous as it is simple, and it is also essentially "done", staying at 1.0.0 for 4 years.however, external dependencies are never free, adding an extra http request to check for the latest version, an extra
rustc
invocation, as well as complicating the build process for projects that don't use cargo.Motivating examples or use cases
the
core
library actually usescfg_if
15 times, and the standard library uses it 65 times. however, becausecore
is not allowed to have dependencies, this means that they are actually using separate, (but identical) macros.Solution sketch
make the copy of
cfg_if
incore
the definitive version, and makestd
depend on that.Alternatives
std
facade, and add it as a seperate sysroot crate.cfg_match
to be stablizedLinks and related work
https://crates.io/crates/cfg-if
What happens now?
This issue contains an API change proposal (or ACP) and is part of the libs-api team feature lifecycle. Once this issue is filed, the libs-api team will review open proposals as capability becomes available. Current response times do not have a clear estimate, but may be up to several months.
Possible responses
The libs team may respond in various different ways. First, the team will consider the problem (this doesn't require any concrete solution or alternatives to have been proposed):
Second, if there's a concrete solution:
The text was updated successfully, but these errors were encountered: