about summary refs log tree commit diff
path: root/tests/ui/consts/const-pattern-irrefutable.rs
AgeCommit message (Collapse)AuthorLines
2025-04-30compiletest: Make diagnostic kind mandatory on line annotationsVadim Petrochenkov-7/+9
2024-11-17Unify expanded constants and named constants in `PatKind`Esteban Küber-3/+18
2024-11-17Use `item_name` instead of a span snippet when talking about const patternEsteban Küber-1/+1
2024-11-17Point at `const` definition when used instead of a binding in a `let` statementEsteban Küber-3/+3
After: ``` error[E0005]: refutable pattern in local binding --> $DIR/bad-pattern.rs:19:13 | LL | const PAT: u32 = 0; | -------------- missing patterns are not covered because `PAT` is interpreted as a constant pattern, not a new variable ... LL | let PAT = v1; | ^^^ | | | pattern `1_u32..=u32::MAX` not covered | help: introduce a variable instead: `PAT_var` | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html = note: the matched value is of type `u32` ``` Before: ``` error[E0005]: refutable pattern in local binding --> $DIR/bad-pattern.rs:19:13 | LL | let PAT = v1; | ^^^ | | | pattern `1_u32..=u32::MAX` not covered | missing patterns are not covered because `PAT` is interpreted as a constant pattern, not a new variable | help: introduce a variable instead: `PAT_var` | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html = note: the matched value is of type `u32` ```
2023-01-11Migrate pattern matchingmejrs-3/+15
2023-01-11Move /src/test to /testsAlbert Larsan-0/+16