2014-09-02 15:55:07 +12:00
|
|
|
// Check that dynamically sized rvalues are forbidden
|
|
|
|
|
|
|
|
pub fn main() {
|
2022-07-07 04:36:10 +02:00
|
|
|
let _x: Box<str> = Box::new(*"hello world");
|
2021-08-20 16:26:24 +02:00
|
|
|
//~^ ERROR E0277
|
2014-09-02 15:55:07 +12:00
|
|
|
|
2015-01-08 21:54:35 +11:00
|
|
|
let array: &[isize] = &[1, 2, 3];
|
2022-07-07 04:36:10 +02:00
|
|
|
let _x: Box<[isize]> = Box::new(*array);
|
2021-08-20 16:26:24 +02:00
|
|
|
//~^ ERROR E0277
|
2014-09-02 15:55:07 +12:00
|
|
|
}
|