rust/tests/ui/auto-traits
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
..
assoc-ty.current.stderr Don't ICE when auto trait has assoc ty in old solver 2024-07-24 17:19:44 -04:00
assoc-ty.next.stderr adjust derive_error 2025-02-13 23:49:09 +01:00
assoc-ty.rs adjust derive_error 2025-02-13 23:49:09 +01:00
auto-is-contextual.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
auto-trait-projection-recursion.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
auto-trait-validation.fixed UI tests: add missing diagnostic kinds where possible 2025-04-08 23:06:31 +03:00
auto-trait-validation.rs UI tests: add missing diagnostic kinds where possible 2025-04-08 23:06:31 +03:00
auto-trait-validation.stderr Update tests 2024-02-07 10:42:01 +08:00
auto-traits.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
auto-traits.stderr Update tests 2024-02-07 10:42:01 +08:00
bad-generics-on-dyn.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
bad-generics-on-dyn.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
has-arguments.rs Extend builtin/auto trait args with error when they have >1 argument 2023-11-06 21:29:08 +00:00
has-arguments.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-23080-2.current.stderr Ignore tests w/ current/next revisions from compare-mode=next-solver 2024-03-10 21:18:41 -04:00
issue-23080-2.next.stderr Ignore tests w/ current/next revisions from compare-mode=next-solver 2024-03-10 21:18:41 -04:00
issue-23080-2.rs Ignore tests w/ current/next revisions from compare-mode=next-solver 2024-03-10 21:18:41 -04:00
issue-23080.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-23080.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-83857-ub.rs Remove suspicious auto trait lint 2024-02-19 17:41:48 -03:00
issue-83857-ub.stderr Normalize each signature input/output in typeck_with_fallback with its own span 2025-01-06 17:58:30 +00:00
issue-84075.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-84075.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-117789.rs Remove suspicious auto trait lint 2024-02-19 17:41:48 -03:00
issue-117789.stderr Remove suspicious auto trait lint 2024-02-19 17:41:48 -03:00
pre-cfg.rs Use cfg(false) in UI tests 2025-04-03 21:41:58 +00:00
pre-cfg.stderr Bless tests 2024-01-13 12:46:58 -05:00
str-contains-slice-conceptually.rs Treat str as containing [u8] for auto trait purposes 2023-02-25 20:01:33 +00:00
str-contains-slice-conceptually.stderr Remove detail from label/note that is already available in other note 2024-10-29 16:26:57 +00:00
typeck-auto-trait-no-supertraits-2.rs Continue to borrowck even if there were previous errors 2024-02-08 08:10:43 +00:00
typeck-auto-trait-no-supertraits-2.stderr Mention type parameter in more cases and don't suggest ~const bound already there 2024-12-07 21:37:13 +00:00
typeck-auto-trait-no-supertraits.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
typeck-auto-trait-no-supertraits.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
typeck-default-trait-impl-constituent-types-2.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
typeck-default-trait-impl-constituent-types-2.stderr Remove detail from label/note that is already available in other note 2024-10-29 16:26:57 +00:00
typeck-default-trait-impl-constituent-types.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
typeck-default-trait-impl-constituent-types.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
typeck-default-trait-impl-negation.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
typeck-default-trait-impl-negation.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
typeck-default-trait-impl-precedence.rs Use root obligation on E0277 for some cases 2024-03-03 18:53:35 +00:00
typeck-default-trait-impl-precedence.stderr Remove detail from label/note that is already available in other note 2024-10-29 16:26:57 +00:00
ungated-impl.rs Delay bug for negative auto trait rather than ICEing 2025-03-07 17:20:57 +00:00
ungated-impl.stderr Delay bug for negative auto trait rather than ICEing 2025-03-07 17:20:57 +00:00