rust-analyzer/crates
Matthias Krüger 0e66ad6b7b
Rollup merge of #138632 - clubby789:stabilize-cfg-boolean-lit, r=davidtwco,Urgau,traviscross
Stabilize `cfg_boolean_literals`

Closes #131204
`@rustbot` labels +T-lang +I-lang-nominated
This will end up conflicting with the test in #138293 so whichever doesn't land first will need updating

--

# Stabilization Report

## General design

### What is the RFC for this feature and what changes have occurred to the user-facing design since the RFC was finalized?

[RFC 3695](https://github.com/rust-lang/rfcs/pull/3695), none.

### What behavior are we committing to that has been controversial? Summarize the major arguments pro/con.

None

### Are there extensions to this feature that remain unstable? How do we know that we are not accidentally committing to those?

None

## Has a call-for-testing period been conducted? If so, what feedback was received?

Yes; only positive feedback was received.

## Implementation quality

### Summarize the major parts of the implementation and provide links into the code (or to PRs)

Implemented in [#131034](https://github.com/rust-lang/rust/pull/131034).

### Summarize existing test coverage of this feature

- [Basic usage, including `#[cfg()]`, `cfg!()` and `#[cfg_attr()]`](6d71251cf9/tests/ui/cfg/true-false.rs)
- [`--cfg=true/false` on the command line being accessible via `r#true/r#false`](6d71251cf9/tests/ui/cfg/raw-true-false.rs)
- [Interaction with the unstable `#[doc(cfg(..))]` feature](6d71251/tests/rustdoc-ui/cfg-boolean-literal.rs)
- [Denying `--check-cfg=cfg(true/false)`](6d71251/tests/ui/check-cfg/invalid-arguments.rs)
- Ensuring `--cfg false` on the command line doesn't change the meaning of `cfg(false)`: `tests/ui/cfg/cmdline-false.rs`
- Ensuring both `cfg(true)` and `cfg(false)` on the same item result in it being disabled: `tests/ui/cfg/both-true-false.rs`

### What outstanding bugs in the issue tracker involve this feature? Are they stabilization-blocking?

The above mentioned issue; it should not block as it interacts with another unstable feature.

### What FIXMEs are still in the code for that feature and why is it ok to leave them there?

None

### Summarize contributors to the feature by name for recognition and assuredness that people involved in the feature agree with stabilization
- `@clubby789` (RFC)
- `@Urgau` (Implementation in rustc)

### Which tools need to be adjusted to support this feature. Has this work been done?

`rustdoc`'s  unstable`#[doc(cfg(..)]` has been updated to respect it. `cargo` has been updated with a forward compatibility lint to enable supporting it in cargo once stabilized.

## Type system and execution rules

### What updates are needed to the reference/specification? (link to PRs when they exist)

A few lines to be added to the reference for configuration predicates, specified in the RFC.
2025-04-17 06:25:15 +02:00
..
base-db enable doctest 2025-02-27 14:58:46 +01:00
cfg Merge pull request #19243 from Veykril/push-qrrqsywkwyzp 2025-03-03 11:42:40 +00:00
edition Make edition per-token, not per-file 2025-01-09 05:43:08 +02:00
hir Suppress must_use for ControlFlow in rust-analyzer 2025-03-16 17:47:57 +00:00
hir-def Auto merge of #136932 - m-ou-se:fmt-width-precision-u16, r=scottmcm 2025-03-11 04:07:05 +00:00
hir-expand Remove attribute #[rustc_error] 2025-03-30 01:32:21 +03:00
hir-ty Revert "remove rust-analyser support for extern "rust-intrinsic" blocks" 2025-04-07 20:30:27 +02:00
ide make hover_feature test less fragile 2025-04-08 12:13:17 +02:00
ide-assists Suppress must_use for ControlFlow in rust-analyzer 2025-03-16 17:47:57 +00:00
ide-completion Revert "remove rust-analyser support for extern "rust-intrinsic" blocks" 2025-04-07 20:30:27 +02:00
ide-db Stabilize cfg_boolean_literals 2025-04-03 18:10:48 +00:00
ide-diagnostics Pass the target crate in HirFormatter 2025-03-06 21:00:05 +02:00
ide-ssr Pass the target crate in HirFormatter 2025-03-06 21:00:05 +02:00
intern Revert "remove rust-analyser support for extern "rust-intrinsic" blocks" 2025-04-07 20:30:27 +02:00
load-cargo Log build script error output in load_cargo::load_workspace_at 2025-03-07 16:07:56 +01:00
mbe Fix syntax fixup producing invalid punctuation 2025-03-08 13:21:00 +01:00
parser Clean up rustc-literal-escaper usage in rust-analyzer 2025-04-05 20:06:52 +02:00
paths ignore doc test that only fails on windows 2025-02-27 15:57:08 +01:00
proc-macro-api enable doctest 2025-02-27 14:58:46 +01:00
proc-macro-srv Disable some r-a tests in bootstrap. 2025-04-14 16:53:24 +02:00
proc-macro-srv-cli Use interior mutability for loaded ProcMacrorv::expanders 2025-02-05 12:01:57 +01:00
profile Use size_of from the prelude instead of imported 2025-03-05 00:48:44 -08:00
project-model Move project MSRV back to 1.78 2025-03-07 07:51:53 +01:00
ra-salsa
rust-analyzer Merge pull request #19330 from ChayimFriedman2/normalize-projection 2025-03-10 09:15:35 +00:00
span Make edition per-token, not per-file 2025-01-09 05:43:08 +02:00
stdx fix doc tests 2025-02-27 14:58:46 +01:00
syntax Clean up rustc-literal-escaper usage in rust-analyzer 2025-04-05 20:06:52 +02:00
syntax-bridge Fix syntax fixup producing invalid punctuation 2025-03-08 13:21:00 +01:00
test-fixture Use correct working directory for non-workspace proc-macro execution 2025-02-17 10:36:32 -05:00
test-utils Use size_of from the prelude instead of imported 2025-03-05 00:48:44 -08:00
toolchain enable doctest 2025-02-27 14:58:46 +01:00
tt Fix syntax fixup producing invalid punctuation 2025-03-08 13:21:00 +01:00
vfs ignore another test that fails on windows 2025-02-27 16:09:00 +01:00
vfs-notify enable doctest 2025-02-27 14:58:46 +01:00