summary refs log tree commit diff
path: root/src/test/ui/dst/dst-rvalue.rs
blob: 5115bee836bc4f9f6d8fecd7506effb6b179bd3c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// Check that dynamically sized rvalues are forbidden

#![feature(box_syntax)]

pub fn main() {
    let _x: Box<str> = box *"hello world";
    //~^ ERROR E0161
    //~^^ ERROR cannot move out of borrowed content

    let array: &[isize] = &[1, 2, 3];
    let _x: Box<[isize]> = box *array;
    //~^ ERROR E0161
    //~^^ ERROR cannot move out of type `[isize]`, a non-copy slice
}