2014-09-02 03:55:07 +00:00
|
|
|
// Check that dynamically sized rvalues are forbidden
|
|
|
|
|
2015-01-08 02:53:58 +00:00
|
|
|
#![feature(box_syntax)]
|
|
|
|
|
2014-09-02 03:55:07 +00:00
|
|
|
pub fn main() {
|
|
|
|
let _x: Box<str> = box *"hello world";
|
|
|
|
//~^ ERROR E0161
|
2019-05-05 11:02:32 +00:00
|
|
|
//~^^ ERROR cannot move out of a shared reference
|
2014-09-02 03:55:07 +00:00
|
|
|
|
2015-01-08 10:54:35 +00:00
|
|
|
let array: &[isize] = &[1, 2, 3];
|
|
|
|
let _x: Box<[isize]> = box *array;
|
2014-09-02 03:55:07 +00:00
|
|
|
//~^ ERROR E0161
|
2019-04-22 07:40:08 +00:00
|
|
|
//~^^ ERROR cannot move out of type `[isize]`, a non-copy slice
|
2014-09-02 03:55:07 +00:00
|
|
|
}
|