]> git.lizzy.rs Git - rust.git/blob - tests/ui/box/into-boxed-slice-fail.rs
Auto merge of #106646 - Amanieu:ilp32-object, r=Mark-Simulacrum
[rust.git] / tests / ui / box / into-boxed-slice-fail.rs
1 #![feature(box_into_boxed_slice)]
2
3 use std::boxed::Box;
4 use std::fmt::Debug;
5 fn main() {
6     let boxed_slice = Box::new([1,2,3]) as Box<[u8]>;
7     let _ = Box::into_boxed_slice(boxed_slice);
8     //~^ ERROR the size for values of type `[u8]` cannot be known at compilation time
9     //~^^ ERROR the size for values of type `[u8]` cannot be known at compilation time
10     let boxed_trait: Box<dyn Debug> = Box::new(5u8);
11     let _ = Box::into_boxed_slice(boxed_trait);
12     //~^ ERROR the size for values of type `dyn Debug` cannot be known at compilation time
13     //~^^ ERROR the size for values of type `dyn Debug` cannot be known at compilation time
14 }