about summary refs log tree commit diff
path: root/tests/ui/half-open-range-patterns
AgeCommit message (Collapse)AuthorLines
2025-04-17Rollup merge of #138632 - clubby789:stabilize-cfg-boolean-lit, ↵Matthias Krüger-4/+4
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()]`](https://github.com/rust-lang/rust/blob/6d71251cf9e40326461f90f8ff9a7024706aea87/tests/ui/cfg/true-false.rs) - [`--cfg=true/false` on the command line being accessible via `r#true/r#false`](https://github.com/rust-lang/rust/blob/6d71251cf9e40326461f90f8ff9a7024706aea87/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-08UI tests: add missing diagnostic kinds where possibleVadim Petrochenkov-3/+3
2025-04-03Use `cfg(false)` in UI testsclubby789-4/+4
2025-03-21remove `feature(inline_const_pat)`lcnr-120/+3
2025-02-10Show diff suggestion format on verbose replacementEsteban Küber-12/+18
``` error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> $DIR/attempted-access-non-fatal.rs:7:15 | LL | let _ = 2.l; | ^ | help: if intended to be a floating point literal, consider adding a `0` after the period and a `f64` suffix | LL - let _ = 2.l; LL + let _ = 2.0f64; | ```
2024-11-23Update tests for new TRPL chapter orderChris Krycho-7/+7
2024-10-06On function and method calls in patterns, link to the bookEsteban Küber-2/+4
``` error: expected a pattern, found an expression --> f889.rs:3:13 | 3 | let (x, y.drop()) = (1, 2); //~ ERROR | ^^^^^^^^ not a pattern | = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html> error[E0532]: expected a pattern, found a function call --> f889.rs:2:13 | 2 | let (x, drop(y)) = (1, 2); //~ ERROR | ^^^^ not a tuple struct or tuple variant | = note: function calls are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html> ``` Fix #97200.
2024-09-18Add suggestions for expressions in patternsLieselotte-6/+28
2024-07-12Make parse error suggestions verbose and fix spansEsteban Küber-19/+113
Go over all structured parser suggestions and make them verbose style. When suggesting to add or remove delimiters, turn them into multiple suggestion parts.
2024-07-08Update f16/f128 FIXMEs that needed (NEG_)INFINITYTrevor Gross-39/+51
2024-06-23Replace `f16` and `f128` pattern matching stubs with real implementationsTrevor Gross-3/+82
This section of code depends on `rustc_apfloat` rather than our internal types, so this is one potential ICE that we should be able to melt now. This also fixes some missing range and match handling in `rustc_middle`.
2024-05-02Stabilize exclusive_rangeRoss Smyth-329/+103
2024-04-12Suppress erroneous suggestionAlan Egerton-12/+0
The suggestion to use `let else` with an uninitialized refutable `let` statement was erroneous: `let else` cannot be used with deferred initialization.
2024-03-13Remove `MaybeInfiniteInt::JustAfterMax`Nadrieril-8/+8
It was inherited from before half-open ranges, but it doesn't pull its weight anymore. We lose a tiny bit of diagnostic precision.
2024-03-09Allow lint where we don't careNadrieril-68/+70
2024-02-16[AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives许杰友 Jieyou Xu (Joe)-6/+6
2024-02-08Continue to borrowck even if there were previous errorsOli Scherer-10/+118
2024-02-05Rollup merge of #116284 - RalfJung:no-nan-match, r=cjgillotMatthias Krüger-84/+81
make matching on NaN a hard error, and remove the rest of illegal_floating_point_literal_pattern These arms would never be hit anyway, so the pattern makes little sense. We have had a future-compat lint against float matches in general for a *long* time, so I hope we can get away with immediately making this a hard error. This is part of implementing https://github.com/rust-lang/rfcs/pull/3535. Closes https://github.com/rust-lang/rust/issues/41620 by removing the lint. https://github.com/rust-lang/reference/pull/1456 updates the reference to match.
2024-02-01`#![feature(inline_const_pat)]` is no longer incompleteMatthew Jasper-1/+0
2024-01-28Handle methodcalls & operators in patternsLieselotte-10/+154
2024-01-26remove illegal_floating_point_literal_pattern lintRalf Jung-84/+81
2024-01-19add help message for `exclusive_range_pattern` errorRowan S-L-0/+8
2024-01-13Bless testsGeorge-lewis-0/+11
Update tests
2024-01-03Recover parentheses in range patternsLieselotte-15/+5
Co-authored-by: León Orell Valerian Liehr <me@fmease.dev>
2023-12-28Don't expect bodyless arms if the pattern can never be a never patternLieselotte-6/+6
2023-12-03Parse a pattern with no armNadrieril-6/+6
2023-11-24Show number in error message even for one errorNilstrieb-5/+5
Co-authored-by: Adrian <adrian.iosdev@gmail.com>
2023-04-03Perform match checking on THIR.Camille GILLOT-103/+12
2023-02-02Improve diagnostic for missing space in range patternclubby789-12/+9
2023-01-30Modify primary span label for E0308Esteban Küber-6/+6
The previous output was unintuitive to users.
2023-01-28Check for missing space between fat arrow and range patternclubby789-0/+27
2023-01-11Move /src/test to /testsAlbert Larsan-0/+2130