summaryrefslogtreecommitdiffstats
path: root/tests/ui/iterators/collect-into-array.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/iterators/collect-into-array.rs')
-rw-r--r--tests/ui/iterators/collect-into-array.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/ui/iterators/collect-into-array.rs b/tests/ui/iterators/collect-into-array.rs
new file mode 100644
index 000000000..99d0d9bd7
--- /dev/null
+++ b/tests/ui/iterators/collect-into-array.rs
@@ -0,0 +1,6 @@
+fn main() {
+ let whatever: [u32; 10] = (0..10).collect();
+ //~^ ERROR an array of type `[u32; 10]` cannot be built directly from an iterator
+ //~| NOTE try collecting into a `Vec<{integer}>`, then using `.try_into()`
+ //~| NOTE required by a bound in `collect`
+}