diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2024-11-20 03:08:52 +0000 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2024-12-04 20:29:36 +0000 |
| commit | 87ddc1ea33edbe1be119d73e57c2783940e797fe (patch) | |
| tree | 1078cb612921aa307c2700910e38c4441beccbd8 /tests/ui/inline-const | |
| parent | c0f00086f85ae1fff34dd2daf6a11850e5bfc2f0 (diff) | |
| download | rust-87ddc1ea33edbe1be119d73e57c2783940e797fe.tar.gz rust-87ddc1ea33edbe1be119d73e57c2783940e797fe.zip | |
Point at generic param through which a const is used in a pattern
```
error[E0158]: constant pattern depends on a generic parameter, which is not allowed
--> $DIR/associated-const-type-parameter-pattern.rs:20:9
|
LL | pub trait Foo {
| -------------
LL | const X: EFoo;
| ------------- constant defined here
...
LL | pub fn test<A: Foo, B: Foo>(arg: EFoo) {
| - constant depends on this generic param
LL | match arg {
LL | A::X => println!("A::X"),
| ^^^^ `const` depends on a generic parameter
```
Diffstat (limited to 'tests/ui/inline-const')
| -rw-r--r-- | tests/ui/inline-const/const-match-pat-generic.stderr | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/ui/inline-const/const-match-pat-generic.stderr b/tests/ui/inline-const/const-match-pat-generic.stderr index 26f72b34eca..cf48161b5e3 100644 --- a/tests/ui/inline-const/const-match-pat-generic.stderr +++ b/tests/ui/inline-const/const-match-pat-generic.stderr @@ -1,14 +1,14 @@ -error[E0158]: constant pattern depends on a generic parameter +error[E0158]: constant pattern depends on a generic parameter, which is not allowed --> $DIR/const-match-pat-generic.rs:7:9 | LL | const { V } => {}, - | ^^^^^^^^^^^ + | ^^^^^^^^^^^ `const` depends on a generic parameter -error[E0158]: constant pattern depends on a generic parameter +error[E0158]: constant pattern depends on a generic parameter, which is not allowed --> $DIR/const-match-pat-generic.rs:19:9 | LL | const { f(V) } => {}, - | ^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ `const` depends on a generic parameter error: aborting due to 2 previous errors |
