Skip to content

Tracking issue for release notes of #149783: stabilize cfg_select! #152944

Closed

Description

@rustbot

This issue tracks the release notes text for #149783.

cc @folkertdev, @traviscross -- original issue/PR authors and assignees for drafting text

See the forge.rust-lang.org chapter about release notes for an overview of how the release team makes use of these tracking issues.

Release notes text

This section should be edited to specify the correct category(s) for the change, with succinct description(s) of what changed. Some things worth considering:

  • Does this need an additional compat notes section?
  • Was this a libs stabilization that should have additional headers to list new APIs under Stabilized APIs and Const Stabilized APIs?
# Stabilized APIs
- [`cfg_select!`](https://doc.rust-lang.org/stable/std/macro.cfg_select.html)

Tip

Use the previous releases for inspiration on how to write the release notes text and which categories to pick.

Release blog section

If this change is notable enough for inclusion in the blog post then this section should be edited to contain a draft for the blog post. Otherwise leave it empty.

The built-in `cfg_select!` macro can be used to select code at compile-time based on multiple configuration predicates.
It expands to the right-hand side of the first arm whose configuration predicate evaluates to `true`.

```rust
cfg_select! {
    unix => {
        fn foo() { /* unix specific functionality */ }
    }
    target_pointer_width = "32" => {
        fn foo() { /* non-unix, 32-bit functionality */ }
    }
    _ => {
        fn foo() { /* fallback implementation */ }
    }
}

let is_unix_str = cfg_select! {
    unix => "unix",
    _ => "not unix",
};
```

Note

If a blog post section is required the release-blog-post label should be added (@rustbot label +release-blog-post) to this issue as otherwise it may be missed by the release team.

Activity

  1. added
    A-attributesArea: Attributes (`#[…]`, `#![…]`)
    T-langRelevant to the language team
    T-libs-api[DEPRECATED; DO NOT USE]
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    relnotesMarks issues that should be documented in the release notes of the next release.
    T-libsRelevant to the library team, which will review and decide on the PR/issue.
    A-run-makeArea: port run-make Makefiles to rmake.rs
    relnotes-tracking-issueMarks issues tracking what text to put in release notes.
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Feb 21, 2026
  2. removed
    A-run-makeArea: port run-make Makefiles to rmake.rs
    on Feb 21, 2026
  3. added
    release-blog-postMarks issues tracking what text to put in the release blog post.
    on Feb 21, 2026
  4. added this to the 1.95.0 milestone on Feb 23, 2026
  5. vlovich commented on Apr 5, 2026

    @vlovich

    One small suggestion for the release notes. Make it clear whether this allows for invalid code like #cfg or requires always valid code on every branch like the if cfg! macro. I think it's the former since it's covering function definitions which cfg! can't do if I recall correctly but it would help to make that even clearer.

  6. removed
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-attributesArea: Attributes (`#[…]`, `#![…]`)A-cfg_selectArea: `cfg_select!`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-langRelevant to the language teamT-libsRelevant to the library team, which will review and decide on the PR/issue.T-libs-api[DEPRECATED; DO NOT USE]release-blog-postMarks issues tracking what text to put in the release blog post.relnotesMarks issues that should be documented in the release notes of the next release.relnotes-tracking-issueMarks issues tracking what text to put in release notes.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions