]> git.lizzy.rs Git - rust.git/blob - src/test/ui/dst/dst-rvalue.rs
Auto merge of #57101 - o01eg:fix-57014, r=alexcrichton
[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 borrowed content
14 }