Skip to content
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

Tracking issue for cfg_if #59442

Closed
gnzlbg opened this issue Mar 26, 2019 · 7 comments
Closed

Tracking issue for cfg_if #59442

gnzlbg opened this issue Mar 26, 2019 · 7 comments
Labels
B-unstable Blocker: Implemented in the nightly compiler and unstable. C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@gnzlbg
Copy link
Contributor

gnzlbg commented Mar 26, 2019

This issue tracks the stabilization of libcore's cfg_if! macro. See: #59443

@jonas-schievink
Copy link
Contributor

Added in #59336, I think?

@jonas-schievink jonas-schievink added B-unstable Blocker: Implemented in the nightly compiler and unstable. C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. labels Mar 26, 2019
@Centril Centril added the T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. label Mar 26, 2019
@SimonSapin
Copy link
Contributor

#59443 was closed, and #59336 adds the macro but does not export it. Closing as there is no public unstable API to track here. Feel free to reopen if/when the macro is exported.

@RalfJung
Copy link
Member

RalfJung commented Nov 6, 2019

In the light of #65860 we might reconsider actually exposing this from libcore: fn-like macros are "more powerful" in some sense than attribute-based ones, in particular around syntax the compiler does not understand. We don't ship a fn-like cfg macro in libcore, but with the recent syntax feature gating issues I feel we should -- and cfg_if seems like a great choice for that.

@gnzlbg
Copy link
Contributor Author

gnzlbg commented Nov 6, 2019

A cfg_if! like addition would require an RFC, and in the PR that proposed adding it a couple of people argued that they would prefer a cfg_match! instead, but nobody has put much work into exploring that. So if somebody wants to purse a solution to the problem, that would be a good place to get started.

@Centril
Copy link
Contributor

Centril commented Nov 7, 2019

Fwiw, while I prefer cfg_match!, I think cfg_if! is a decent solution as well.
cc @SimonSapin & @alexcrichton -- does this require an RFC or is a PR enough?

@RalfJung
Copy link
Member

RalfJung commented Nov 7, 2019

Agreed, match seems more Rust-y than an if-else chain.

@alexcrichton
Copy link
Member

Given the contention in the past with cfg_if! it feels like its best to be safe and have an RFC for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B-unstable Blocker: Implemented in the nightly compiler and unstable. C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

6 participants