Skip to content

Allow boolean literals in --check-cfg #854

Closed
@clubby789

Description

@clubby789

Proposal

Currently, the --check-cfg option denies boolean literals, despite --cfg allowing them (they can be accessed in code via cfg!(r#true).) The flag should be amended to allow this.

This is also consistent with keywords such as while, which can be specified under --cfg and --check-cfg then accessed with raw identifiers (#[cfg(r#while)]).

This was noticed in the cfg_boolean_literals stabilization and requested by T-lang.

The change is implemented in rust-lang/rust#138767 and is insta-stable.

Context:
rust-lang/rust#138632 (comment)
rust-lang/rust#138767

Mentors or Reviewers

@Urgau

Process

The main points of the Major Change Process are as follows:

  • File an issue describing the proposal.
  • A compiler team member or contributor who is knowledgeable in the area can second by writing @rustbot second.
    • Finding a "second" suffices for internal changes. If however, you are proposing a new public-facing feature, such as a -C flag, then full team check-off is required.
    • Compiler team members can initiate a check-off via @rfcbot fcp merge on either the MCP or the PR.
  • Once an MCP is seconded, the Final Comment Period begins. If no objections are raised after 10 days, the MCP is considered approved.

You can read more about Major Change Proposals on forge.

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-compilerAdd this label so rfcbot knows to poll the compiler teammajor-changeA proposal to make a major change to rustcmajor-change-acceptedA major change proposal that was accepted

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions