]> git.lizzy.rs Git - rust.git/blob - src/test/ui/dst/dst-rvalue.rs
Auto merge of #60155 - davidtwco:issue-59819, r=oli-obk
[rust.git] / src / test / ui / dst / dst-rvalue.rs
1 // Check that dynamically sized rvalues are forbidden
2
3 #![feature(box_syntax)]
4
5 pub fn main() {
6     let _x: Box<str> = box *"hello world";
7     //~^ ERROR E0161
8     //~^^ ERROR cannot move out of borrowed content
9
10     let array: &[isize] = &[1, 2, 3];
11     let _x: Box<[isize]> = box *array;
12     //~^ ERROR E0161
13     //~^^ ERROR cannot move out of type `[isize]`, a non-copy slice
14 }