rust/tests/ui/consts/const_in_pattern
Esteban Küber c6205055e0 On const pattern errors, point at the const item definition
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-12-04 20:29:35 +00:00
..
auxiliary Move /src/test to /tests 2023-01-11 09:32:08 +00:00
accept_structural.rs remove IndirectStructuralMatch lint, emit the usual hard error instead 2024-05-03 15:56:59 +02:00
cross-crate-fail.rs remove IndirectStructuralMatch lint, emit the usual hard error instead 2024-05-03 15:56:59 +02:00
cross-crate-fail.stderr On const pattern errors, point at the const item definition 2024-12-04 20:29:35 +00:00
cross-crate-pass.rs remove IndirectStructuralMatch lint, emit the usual hard error instead 2024-05-03 15:56:59 +02:00
custom-eq-branch-pass.rs const_to_pat: cleanup leftovers from when we had to deal with non-structural constants 2024-07-18 11:58:16 +02:00
f16-f128-const-reassign.rs Change a fixed crash test to a standard test 2024-06-23 04:28:42 -05:00
incomplete-slice.rs remove StructuralEq trait 2024-01-24 07:56:23 +01:00
incomplete-slice.stderr Unify expanded constants and named constants in PatKind 2024-11-17 23:40:00 +00:00
issue-34784-match-on-non-int-raw-ptr.rs turn pointer_structural_match into a hard error 2024-05-03 15:56:59 +02:00
issue-34784-match-on-non-int-raw-ptr.stderr On const pattern errors, point at the const item definition 2024-12-04 20:29:35 +00:00
issue-44333.rs turn pointer_structural_match into a hard error 2024-05-03 15:56:59 +02:00
issue-44333.stderr On const pattern errors, point at the const item definition 2024-12-04 20:29:35 +00:00
issue-53708.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-62614.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-65466.rs make non-PartialEq-typed consts as patterns a hard error 2024-02-25 11:30:10 +01:00
issue-65466.stderr On const pattern errors, point at the const item definition 2024-12-04 20:29:35 +00:00
issue-73431.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
no-eq-branch-fail.rs remove IndirectStructuralMatch lint, emit the usual hard error instead 2024-05-03 15:56:59 +02:00
no-eq-branch-fail.stderr On const pattern errors, point at the const item definition 2024-12-04 20:29:35 +00:00
null-raw-ptr-issue-119270.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
reject_non_partial_eq.rs const_to_pat: cleanup leftovers from when we had to deal with non-structural constants 2024-07-18 11:58:16 +02:00
reject_non_partial_eq.stderr On const pattern errors, point at the const item definition 2024-12-04 20:29:35 +00:00
reject_non_structural.rs On const pattern errors, point at the const item definition 2024-12-04 20:29:35 +00:00
reject_non_structural.stderr On const pattern errors, point at the const item definition 2024-12-04 20:29:35 +00:00