]> git.lizzy.rs Git - rust.git/blob - src/test/ui/iterators/collect-into-slice.rs
Auto merge of #96495 - Dylan-DPC:rollup-9lm4tpp, r=Dylan-DPC
[rust.git] / src / test / ui / iterators / collect-into-slice.rs
1 fn process_slice(data: &[i32]) {
2     //~^ NOTE required by a bound in this
3     todo!()
4 }
5
6 fn main() {
7     let some_generated_vec = (0..10).collect();
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 all local variables must have a statically known size
13     //~| NOTE doesn't have a size known at compile-time
14     process_slice(&some_generated_vec);
15 }