]> git.lizzy.rs Git - rust.git/blob - tests/ui/iterators/collect-into-slice.rs
Rollup merge of #106397 - compiler-errors:new-solver-impl-wc, r=lcnr
[rust.git] / tests / ui / iterators / collect-into-slice.rs
1 fn process_slice(data: &[i32]) {
2     todo!()
3 }
4
5 fn main() {
6     let some_generated_vec = (0..10).collect();
7     //~^ ERROR the size for values of type `[i32]` cannot be known at compilation time
8     //~| ERROR the size for values of type `[i32]` cannot be known at compilation time
9     //~| ERROR a slice of type `[i32]` cannot be built since `[i32]` has no definite size
10     //~| NOTE try explicitly collecting into a `Vec<{integer}>`
11     //~| NOTE required by a bound in `collect`
12     //~| NOTE required by a bound in `collect`
13     //~| NOTE all local variables must have a statically known size
14     //~| NOTE doesn't have a size known at compile-time
15     //~| NOTE doesn't have a size known at compile-time
16     process_slice(&some_generated_vec);
17 }