]> git.lizzy.rs Git - rust.git/blob - tests/ui/unsized-locals/unsized-locals-using-unsized-fn-params.rs
Rollup merge of #106427 - mejrs:translation_errors, r=davidtwco
[rust.git] / tests / ui / unsized-locals / unsized-locals-using-unsized-fn-params.rs
1 #![feature(box_patterns)]
2 #![feature(unsized_fn_params)]
3
4 #[allow(dead_code)]
5 fn f1(box box _b: Box<Box<[u8]>>) {}
6 //~^ ERROR: the size for values of type `[u8]` cannot be known at compilation time [E0277]
7
8 fn f2((_x, _y): (i32, [i32])) {}
9 //~^ ERROR: the size for values of type `[i32]` cannot be known at compilation time [E0277]
10
11 fn main() {
12     let foo: Box<[u8]> = Box::new(*b"foo");
13     let _foo: [u8] = *foo;
14     //~^ ERROR: the size for values of type `[u8]` cannot be known at compilation time [E0277]
15 }