]> git.proxmox.com Git - rustc.git/blame - src/test/ui/iterators/collect-into-slice.rs
New upstream version 1.62.1+dfsg1
[rustc.git] / src / test / ui / iterators / collect-into-slice.rs
CommitLineData
5099ac24
FG
1fn process_slice(data: &[i32]) {
2 //~^ NOTE required by a bound in this
3 todo!()
4}
5
6fn main() {
7 let some_generated_vec = (0..10).collect();
8 //~^ ERROR the size for values of type `[i32]` cannot be known at compilation time
04454e1e 9 //~| ERROR a slice of type `[i32]` cannot be built since `[i32]` has no definite size
5099ac24
FG
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}