| Age | Commit message (Collapse) | Author | Lines | |
|---|---|---|---|---|
| 2025-05-03 | compiletest: Do not require annotations on empty labels and suggestions | Vadim Petrochenkov | -5/+4 | |
| 2025-04-07 | compiletest: Avoid ignoring empty diagnostics in one more place | Vadim Petrochenkov | -4/+5 | |
| This catches some silly notes emitted by rustc, which should ideally be fixed | ||||
| 2025-04-01 | add tests for array/slice const patterns | dianne | -0/+137 | |
| 2025-01-11 | Avoid unnecessary note when type has escaping bounds | Esteban Küber | -1/+0 | |
| 2025-01-11 | Avoid duplicated note | Esteban Küber | -1/+0 | |
| 2025-01-11 | Account for `for<'a>` types when checking for non-structural type in ↵ | Esteban Küber | -0/+30 | |
| constant as pattern When we encounter a constant in a pattern, we check if it is non-structural. If so, we check if the type implements `PartialEq`, but for types with escaping bound vars the check would be incorrect as is, so we break early. This is ok because these types would be filtered anyways. Fix #134764. | ||||
| 2024-12-04 | Add more context to fall-through "const pattern of non-structural type" error | Esteban Küber | -2/+6 | |
| Point at types that need to be marked with `#[derive(PartialEq)]`. We use a visitor to look at a type that isn't structural, looking for all ADTs that don't derive `PartialEq`. These can either be manual `impl PartialEq`s or no `impl` at all, so we differentiate between those two cases to provide more context to the user. We also only point at types and impls from the local crate, otherwise show only a note. ``` error: constant of non-structural type `&[B]` in a pattern --> $DIR/issue-61188-match-slice-forbidden-without-eq.rs:15:9 | LL | struct B(i32); | -------- must be annotated with `#[derive(PartialEq)]` to be usable in patterns LL | LL | const A: &[B] = &[]; | ------------- constant defined here ... LL | A => (), | ^ constant of non-structural type | = note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralPartialEq.html for details ``` | ||||
| 2024-12-04 | Add context to fall-through "const pattern of non-structural type" error | Esteban Küber | -0/+6 | |
| Unify wording with the regular non-structural type error. | ||||
| 2024-12-04 | Add additional context for non-sructural type constant used in pattern | Esteban Küber | -98/+171 | |
| - Point at type that should derive `PartialEq` to be structural. - Point at manual `impl PartialEq`, explaining that it is not sufficient to be structural. ``` error: constant of non-structural type `MyType` in a pattern --> $DIR/const-partial_eq-fallback-ice.rs:14:12 | LL | struct MyType; | ------------- `MyType` must be annotated with `#[derive(PartialEq)]` to be usable in patterns ... LL | const CONSTANT: &&MyType = &&MyType; | ------------------------ constant defined here ... LL | if let CONSTANT = &&MyType { | ^^^^^^^^ constant of non-structural type | note: the `PartialEq` trait must be derived, manual `impl`s are not sufficient; see https://doc.rust-lang.org/stable/std/marker/trait.StructuralPartialEq.html for details --> $DIR/const-partial_eq-fallback-ice.rs:5:1 | LL | impl PartialEq<usize> for MyType { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ``` | ||||
| 2024-12-04 | Reword message for non-structural type constant in pattern | Esteban Küber | -4/+4 | |
| 2024-12-04 | Tweak output of some const pattern errors | Esteban Küber | -2/+2 | |
| - Add primary span labels. - Point at const generic parameter used as pattern. - Point at statics used as pattern. - Point at let bindings used in const pattern. | ||||
| 2024-12-04 | Tweak ptr in pattern error | Esteban Küber | -12/+24 | |
| Conform to error style guide. | ||||
| 2024-12-04 | On `const` pattern errors, point at the `const` item definition | Esteban Küber | -10/+68 | |
| Centralize emitting an error in `const_to_pat` so that all errors from that evaluating a `const` in a pattern can add addditional information. With this, now point at the `const` item's definition: ``` error[E0158]: constant pattern depends on a generic parameter --> $DIR/associated-const-type-parameter-pattern.rs:20:9 | LL | pub trait Foo { | ------------- LL | const X: EFoo; | ------------- constant defined here ... LL | A::X => println!("A::X"), | ^^^^ ``` | ||||
| 2024-11-17 | Unify expanded constants and named constants in `PatKind` | Esteban Küber | -0/+12 | |
| 2024-07-18 | const_to_pat: cleanup leftovers from when we had to deal with non-structural ↵ | Ralf Jung | -5/+13 | |
| constants | ||||
| 2024-06-23 | Change a fixed crash test to a standard test | Trevor Gross | -0/+14 | |
| Fixes <https://github.com/rust-lang/rust/issues/122587> | ||||
| 2024-05-03 | turn pointer_structural_match into a hard error | Ralf Jung | -140/+11 | |
| 2024-05-03 | remove IndirectStructuralMatch lint, emit the usual hard error instead | Ralf Jung | -53/+16 | |
| 2024-02-25 | Auto merge of #120393 - Urgau:rfc3373-non-local-defs, r=WaffleLapkin | bors | -0/+1 | |
| Implement RFC 3373: Avoid non-local definitions in functions This PR implements [RFC 3373: Avoid non-local definitions in functions](https://github.com/rust-lang/rust/issues/120363). | ||||
| 2024-02-25 | make non-PartialEq-typed consts as patterns a hard error | Ralf Jung | -24/+4 | |
| 2024-02-17 | Allow newly added non_local_definitions lint in tests | Urgau | -0/+1 | |
| 2024-02-16 | [AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives | 许杰友 Jieyou Xu (Joe) | -13/+13 | |
| 2024-02-05 | merge the accepted-structural-match tests into one | Ralf Jung | -34/+14 | |
| 2024-02-05 | update the tracking issue for structural match violations | Ralf Jung | -15/+15 | |
| and bless a test I missed | ||||
| 2024-02-05 | show indirect_structural_match and pointer_structural_match in future compat ↵ | Ralf Jung | -0/+107 | |
| reports | ||||
| 2024-02-05 | get rid of nontrivial_structural_match lint and custom_eq const qualif | Ralf Jung | -99/+4 | |
| 2024-01-24 | remove StructuralEq trait | Ralf Jung | -130/+71 | |
| 2024-01-02 | Adjust compiler tests for unused_tuple_struct_fields -> dead_code | Jake Goulding | -2/+2 | |
| 2023-12-24 | fix ICE when using raw ptr in a pattern | Ralf Jung | -0/+33 | |
| 2023-11-24 | Show number in error message even for one error | Nilstrieb | -4/+4 | |
| Co-authored-by: Adrian <adrian.iosdev@gmail.com> | ||||
| 2023-11-12 | patterns: don't ice when encountering a raw str slice | Ralf Jung | -2/+19 | |
| 2023-10-28 | also lint against fn ptr and raw ptr nested inside the const | Ralf Jung | -3/+23 | |
| 2023-10-28 | patterns: reject raw pointers that are not just integers | Ralf Jung | -4/+50 | |
| 2023-10-11 | Prevent spurious `unreachable pattern` lints | Oli Scherer | -17/+1 | |
| Means you'll get more `non-exhaustive` patterns | ||||
| 2023-10-05 | Add a note to duplicate diagnostics | Alex Macleod | -24/+14 | |
| 2023-09-25 | rename lint; add tracking issue | Ralf Jung | -4/+4 | |
| 2023-09-24 | work towards rejecting consts in patterns that do not implement PartialEq | Ralf Jung | -1/+25 | |
| 2023-06-29 | tests: unset `RUSTC_LOG_COLOR` | David Wood | -0/+1 | |
| Setting `RUSTC_LOG_COLOR=always` is sometimes useful if tools that one pipes `RUSTC_LOG` into support coloured output, but it makes this test fail. Signed-off-by: David Wood <david@davidtw.co> | ||||
| 2023-04-03 | Perform match checking on THIR. | Camille GILLOT | -1/+1 | |
| 2023-03-27 | Add notes to non-structural const in pattern error message | Jamen Marz | -10/+91 | |
| 2023-01-11 | Move /src/test to /tests | Albert Larsan | -0/+744 | |
