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 RFC 3695: Allow boolean literals as cfg predicates #131204

Open
2 of 4 tasks
clubby789 opened this issue Oct 3, 2024 · 4 comments
Open
2 of 4 tasks
Labels
B-RFC-approved Blocker: Approved by a merged RFC but not yet implemented. B-RFC-implemented Blocker: Approved by a merged RFC and implemented. C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC T-lang Relevant to the language team, which will review and decide on the PR/issue.

Comments

@clubby789
Copy link
Contributor

clubby789 commented Oct 3, 2024

This is a tracking issue for the RFC "Allow boolean literals as cfg predicates" (rust-lang/rfcs/#3695).
The feature gate for the issue is #![feature(cfg_boolean_literals)].

About tracking issues

Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Discussion comments will get marked as off-topic or deleted.
Repeated discussions on the tracking issue may lead to the tracking issue getting locked.

Steps

Unresolved Questions

None.

Related

@clubby789 clubby789 added C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC T-lang Relevant to the language team, which will review and decide on the PR/issue. labels Oct 3, 2024
@traviscross traviscross changed the title Tracking Issue for RFC 3695: Allow boolean literals as cfg predicates Tracking issue for RFC 3695: Allow boolean literals as cfg predicates Oct 4, 2024
@traviscross traviscross added the B-RFC-approved Blocker: Approved by a merged RFC but not yet implemented. label Oct 4, 2024
@Urgau Urgau added the B-RFC-implemented Blocker: Approved by a merged RFC and implemented. label Jan 3, 2025
@Urgau
Copy link
Member

Urgau commented Jan 3, 2025

Call for testing

This is call for testing regarding RFC3695: Allow boolean literals as cfg predicates.

RFC 3695 adds support for true & false in #[cfg], #[cfg_attr] and cfg! predicates.

Testing instructions

Requires: nightly-2024-10-06 or newer with feature(cfg_boolean_literals).

  • Use #[cfg(true)], #[cfg(false)] with (or without) any/all/not.

Feedback

  • Did the feature work as expected?
  • Were there surprising results?

@rustbot label +call-for-testing

@rustbot rustbot added the call-for-testing Marks issues that require broader testing from the community, e.g. before stabilization. label Jan 3, 2025
@U007D
Copy link

U007D commented Jan 7, 2025

Hi. This will appear in This Week in Rust issue #581 under "Call for Testing". You may remove the call-for-testing label, or retain it (in which case it will appear again in the following issue of TWiR).

@clubby789
Copy link
Contributor Author

With a quick review:

  • #[cfg(true)], #[cfg(false)] and variants (all/any/not) work as expected
  • Same for cfg_attrs
  • cfg!(true) and cfg!(false) work
  • r#true and r#false are also unchanged as specified:
[poc.rs:4:5] cfg!(true) = true
[poc.rs:5:5] cfg!(false) = false
[poc.rs:6:5] cfg!(r#true) = false
[poc.rs:7:5] cfg!(r#false) = false

@U007D

This comment has been minimized.

@clubby789 clubby789 removed the call-for-testing Marks issues that require broader testing from the community, e.g. before stabilization. label Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B-RFC-approved Blocker: Approved by a merged RFC but not yet implemented. B-RFC-implemented Blocker: Approved by a merged RFC and implemented. C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC T-lang Relevant to the language team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants