rust/tests/ui/rfcs
Matthias Krüger 0de803c38d
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](https://github.com/rust-lang/rust/tree/6d71251/tests/rustdoc-ui/cfg-boolean-literal.rs)
- [Denying `--check-cfg=cfg(true/false)`](https://github.com/rust-lang/rust/tree/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
..
impl-trait Remove some annotations that just specify the default 2024-02-22 16:56:26 +00:00
rfc-0000-never_patterns Always perform discr read for never pattern in EUV 2025-02-11 21:12:47 +00:00
rfc-0107-bind-by-move-pattern-guards Suggest .clone() in some move errors 2024-04-11 16:41:41 +00:00
rfc-1014-stdout-existential-crisis Remove libc from more tests 2024-04-17 08:36:49 -04:00
rfc-1445-restrict-constants-in-patterns Remove attribute #[rustc_error] 2025-03-30 01:32:21 +03:00
rfc-1623-static properly fill a promoted's required_consts 2024-04-23 23:02:54 +02:00
rfc-1717-dllimport compiletest: Require //~ annotations even if error-pattern is specified 2025-04-03 11:08:55 +03:00
rfc-1789-as-cell [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
rfc-1857-stabilize-drop-order [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
rfc-1937-termination-trait Change how anonymous associated types are printed. 2025-04-11 20:13:16 +10:00
rfc-2005-default-binding-mode [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
rfc-2008-non-exhaustive UI tests: add missing diagnostic kinds where possible 2025-04-08 23:06:31 +03:00
rfc-2091-track-caller compiletest: Support matching on diagnostics without a span 2025-03-25 17:33:09 +03:00
rfc-2093-infer-outlives UI tests: add missing diagnostic kinds where possible 2025-04-08 23:06:31 +03:00
rfc-2126-crate-paths Show number in error message even for one error 2023-11-24 19:15:52 +01:00
rfc-2126-extern-absolute-paths Trim suggestion parts to the subset that is purely additive 2025-02-14 00:44:10 -08:00
rfc-2151-raw-identifiers [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
rfc-2175-or-if-while-let [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
rfc-2294-if-let-guard Use cfg(false) in UI tests 2025-04-03 21:41:58 +00:00
rfc-2302-self-struct-ctor [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
rfc-2306-convert-id [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
rfc-2361-dbg-macro Remove detail from label/note that is already available in other note 2024-10-29 16:26:57 +00:00
rfc-2396-target_feature-11 Stabilize target_feature_11 2025-01-27 23:44:47 +01:00
rfc-2421-unreserve-pure-offsetof-sizeof-alignof [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
rfc-2457-non-ascii-idents UI tests: add missing diagnostic kinds where possible 2025-04-08 23:06:31 +03:00
rfc-2497-if-let-chains Use cfg(false) in UI tests 2025-04-03 21:41:58 +00:00
rfc-2528-type-changing-struct-update UI tests: add missing diagnostic kinds where possible 2025-04-08 23:06:31 +03:00
rfc-2565-param-attrs Use cfg(false) in UI tests 2025-04-03 21:41:58 +00:00
rfc-3348-c-string-literals Update tests to use new proc-macro header 2024-11-27 07:18:25 -08:00
rfc-3467-unsafe-pinned Initial UnsafePinned/UnsafeUnpin impl [Part 1: Libs] 2025-04-13 01:11:04 -04:00
type-alias-impl-trait Implement #[define_opaque] attribute for functions. 2025-03-11 12:05:02 +00:00
rfc-3391-result-ffi-guarantees.rs lang: Strengthen RFC 3391 guarantees to match T-lang consensus 2024-10-21 00:43:36 -07:00