summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDylan DPC <dylan.dpc@gmail.com>2020-03-27 01:23:55 +0100
committerGitHub <noreply@github.com>2020-03-27 01:23:55 +0100
commitfa15774a4b3466ac71a0f84871c0106591484fd4 (patch)
tree274c58c487448e0f043ca91acd85c82d1a1164b2
parentRollup merge of #70344 - Centril:hir-pretty, r=eddyb (diff)
parentAdd regression test for #66706 (diff)
downloadrust-fa15774a4b3466ac71a0f84871c0106591484fd4.tar.gz
rust-fa15774a4b3466ac71a0f84871c0106591484fd4.tar.bz2
rust-fa15774a4b3466ac71a0f84871c0106591484fd4.tar.xz
Rollup merge of #70435 - Alexendoo:test-66706, r=Centril
Add regression test for #66706 Adds the two cases that no longer ICE (https://github.com/rust-lang/rust/issues/66706#issuecomment-604098436)
-rw-r--r--src/test/ui/issues/issue-66706.rs13
-rw-r--r--src/test/ui/issues/issue-66706.stderr32
2 files changed, 45 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-66706.rs b/src/test/ui/issues/issue-66706.rs
new file mode 100644
index 0000000..5e64f63
--- /dev/null
+++ b/src/test/ui/issues/issue-66706.rs
@@ -0,0 +1,13 @@
1fn a() {
2 [0; [|_: _ &_| ()].len()]
3 //~^ ERROR expected `,`, found `&`
4 //~| ERROR type annotations needed
5 //~| ERROR mismatched types
6}
7
8fn b() {
9 [0; [|f @ &ref _| {} ; 0 ].len() ];
10 //~^ ERROR expected identifier, found reserved identifier `_`
11}
12
13fn main() {}
diff --git a/src/test/ui/issues/issue-66706.stderr b/src/test/ui/issues/issue-66706.stderr
new file mode 100644
index 0000000..6d290bc
--- /dev/null
+++ b/src/test/ui/issues/issue-66706.stderr
@@ -0,0 +1,32 @@
1error: expected `,`, found `&`
2 --> $DIR/issue-66706.rs:2:16
3 |
4LL | [0; [|_: _ &_| ()].len()]
5 | -^ expected `,`
6 | |
7 | help: missing `,`
8
9error: expected identifier, found reserved identifier `_`
10 --> $DIR/issue-66706.rs:9:20
11 |
12LL | [0; [|f @ &ref _| {} ; 0 ].len() ];
13 | ^ expected identifier, found reserved identifier
14
15error[E0282]: type annotations needed
16 --> $DIR/issue-66706.rs:2:11
17 |
18LL | [0; [|_: _ &_| ()].len()]
19 | ^ consider giving this closure parameter a type
20
21error[E0308]: mismatched types
22 --> $DIR/issue-66706.rs:2:5
23 |
24LL | fn a() {
25 | - help: try adding a return type: `-> [{integer}; _]`
26LL | [0; [|_: _ &_| ()].len()]
27 | ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found array `[{integer}; _]`
28
29error: aborting due to 4 previous errors
30
31Some errors have detailed explanations: E0282, E0308.
32For more information about an error, try `rustc --explain E0282`.