diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-01-21 22:03:16 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-21 22:03:16 +0100 |
| commit | 1f3a2dd0b1990bbb2e225f3b341a225e171f6c91 (patch) | |
| tree | 04e7cd3acc9aa96527bffa13b0bcc900ee2f04c3 /src | |
| parent | 430673f26590f5f40bb6a6587d43136d0b5604dc (diff) | |
| parent | ef46e38c2bc9c86dcc48b511885630ed9f842a55 (diff) | |
| download | rust-1f3a2dd0b1990bbb2e225f3b341a225e171f6c91.tar.gz rust-1f3a2dd0b1990bbb2e225f3b341a225e171f6c91.zip | |
Rollup merge of #92963 - terrarier2111:tuple-diagnostic, r=davidtwco
Implement tuple array diagnostic Fixes https://github.com/rust-lang/rust/issues/92089
Diffstat (limited to 'src')
| -rw-r--r-- | src/test/ui/issues/issue-5100.stderr | 6 | ||||
| -rw-r--r-- | src/test/ui/tuple/array-diagnostics.rs | 7 | ||||
| -rw-r--r-- | src/test/ui/tuple/array-diagnostics.stderr | 9 |
3 files changed, 18 insertions, 4 deletions
diff --git a/src/test/ui/issues/issue-5100.stderr b/src/test/ui/issues/issue-5100.stderr index de71e1d1a66..c87a3e348a2 100644 --- a/src/test/ui/issues/issue-5100.stderr +++ b/src/test/ui/issues/issue-5100.stderr @@ -59,10 +59,8 @@ LL | &(true, false) => () error[E0618]: expected function, found `(char, char)` --> $DIR/issue-5100.rs:48:14 | -LL | let v = [('a', 'b') - | ______________-^^^^^^^^^ -LL | | ('c', 'd'), - | |_______________________- call expression requires function +LL | let v = [('a', 'b') + | ^^^^^^^^^^- help: consider separating array elements with a comma: `,` error[E0308]: mismatched types --> $DIR/issue-5100.rs:55:19 diff --git a/src/test/ui/tuple/array-diagnostics.rs b/src/test/ui/tuple/array-diagnostics.rs new file mode 100644 index 00000000000..1929dab0731 --- /dev/null +++ b/src/test/ui/tuple/array-diagnostics.rs @@ -0,0 +1,7 @@ +fn main() { + let _tmp = [ + ("C200B40A82", 3), + ("C200B40A83", 4) //~ ERROR: expected function, found `(&'static str, {integer})` [E0618] + ("C200B40A8537", 5), + ]; +} diff --git a/src/test/ui/tuple/array-diagnostics.stderr b/src/test/ui/tuple/array-diagnostics.stderr new file mode 100644 index 00000000000..a10d7af470c --- /dev/null +++ b/src/test/ui/tuple/array-diagnostics.stderr @@ -0,0 +1,9 @@ +error[E0618]: expected function, found `(&'static str, {integer})` + --> $DIR/array-diagnostics.rs:4:9 + | +LL | ("C200B40A83", 4) + | ^^^^^^^^^^^^^^^^^- help: consider separating array elements with a comma: `,` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0618`. |
