diff options
| author | b-naber <bn263@gmx.de> | 2022-04-12 18:14:28 +0200 |
|---|---|---|
| committer | b-naber <bn263@gmx.de> | 2022-05-16 15:58:15 +0200 |
| commit | 96b36d6eb21daaca2c2d04fd8d7c27bef5eb90c6 (patch) | |
| tree | 72d103dc5986ab6608c5976422d14002a2cb6020 /src/test/ui/inline-const | |
| parent | 56d540e0571ac1b0633ce10644224c495aaf42a0 (diff) | |
| download | rust-96b36d6eb21daaca2c2d04fd8d7c27bef5eb90c6.tar.gz rust-96b36d6eb21daaca2c2d04fd8d7c27bef5eb90c6.zip | |
use GlobalId in eval_to_valtree query and introduce query for valtree_to_const_val
Diffstat (limited to 'src/test/ui/inline-const')
| -rw-r--r-- | src/test/ui/inline-const/const-match-pat-generic.rs | 3 | ||||
| -rw-r--r-- | src/test/ui/inline-const/const-match-pat-generic.stderr | 15 |
2 files changed, 12 insertions, 6 deletions
diff --git a/src/test/ui/inline-const/const-match-pat-generic.rs b/src/test/ui/inline-const/const-match-pat-generic.rs index e1946467583..7c0d83516ea 100644 --- a/src/test/ui/inline-const/const-match-pat-generic.rs +++ b/src/test/ui/inline-const/const-match-pat-generic.rs @@ -6,7 +6,8 @@ fn foo<const V: usize>() { match 0 { const { V } => {}, - //~^ ERROR const parameters cannot be referenced in patterns [E0158] + //~^ ERROR constant pattern depends on a generic parameter + //~| ERROR constant pattern depends on a generic parameter _ => {}, } } diff --git a/src/test/ui/inline-const/const-match-pat-generic.stderr b/src/test/ui/inline-const/const-match-pat-generic.stderr index ade200d99ba..77267f12fb1 100644 --- a/src/test/ui/inline-const/const-match-pat-generic.stderr +++ b/src/test/ui/inline-const/const-match-pat-generic.stderr @@ -1,21 +1,26 @@ -error[E0158]: const parameters cannot be referenced in patterns +error: constant pattern depends on a generic parameter --> $DIR/const-match-pat-generic.rs:8:9 | LL | const { V } => {}, | ^^^^^^^^^^^ error: constant pattern depends on a generic parameter - --> $DIR/const-match-pat-generic.rs:20:9 + --> $DIR/const-match-pat-generic.rs:21:9 | LL | const { f(V) } => {}, | ^^^^^^^^^^^^^^ error: constant pattern depends on a generic parameter - --> $DIR/const-match-pat-generic.rs:20:9 + --> $DIR/const-match-pat-generic.rs:8:9 + | +LL | const { V } => {}, + | ^^^^^^^^^^^ + +error: constant pattern depends on a generic parameter + --> $DIR/const-match-pat-generic.rs:21:9 | LL | const { f(V) } => {}, | ^^^^^^^^^^^^^^ -error: aborting due to 3 previous errors +error: aborting due to 4 previous errors -For more information about this error, try `rustc --explain E0158`. |
