|
| 1 | +warning: the feature `unsized_locals` is incomplete and may not be safe to use and/or cause compiler crashes |
| 2 | + --> $DIR/extern-types-unsizing-79409.rs:2:12 |
| 3 | + | |
| 4 | +LL | #![feature(unsized_locals)] |
| 5 | + | ^^^^^^^^^^^^^^ |
| 6 | + | |
| 7 | + = note: see issue #48055 <https://github.com/rust-lang/rust/issues/48055> for more information |
| 8 | + = note: `#[warn(incomplete_features)]` on by default |
| 9 | + |
| 10 | +error[E0277]: the size for values of type `Device` cannot be known |
| 11 | + --> $DIR/extern-types-unsizing-79409.rs:11:28 |
| 12 | + | |
| 13 | +LL | unsafe fn make_device() -> Box<Device> { |
| 14 | + | ^^^^^^^^^^^ doesn't have a known size |
| 15 | + | |
| 16 | + = help: the trait `MetaSized` is not implemented for `Device` |
| 17 | +note: required by a bound in `Box` |
| 18 | + --> $SRC_DIR/alloc/src/boxed.rs:LL:COL |
| 19 | + |
| 20 | +error[E0277]: the size for values of type `Device` cannot be known |
| 21 | + --> $DIR/extern-types-unsizing-79409.rs:13:19 |
| 22 | + | |
| 23 | +LL | Box::from_raw(0 as *mut _) |
| 24 | + | ------------- ^^^^^^^^^^^ the trait `MetaSized` is not implemented for `Device` |
| 25 | + | | |
| 26 | + | required by a bound introduced by this call |
| 27 | + | |
| 28 | + = note: the trait bound `Device: MetaSized` is not satisfied |
| 29 | +note: required by a bound in `Box::<T>::from_raw` |
| 30 | + --> $SRC_DIR/alloc/src/boxed.rs:LL:COL |
| 31 | +help: consider borrowing here |
| 32 | + | |
| 33 | +LL | Box::from_raw(&0 as *mut _) |
| 34 | + | + |
| 35 | +LL | Box::from_raw(&mut 0 as *mut _) |
| 36 | + | ++++ |
| 37 | + |
| 38 | +error[E0277]: the size for values of type `Device` cannot be known |
| 39 | + --> $DIR/extern-types-unsizing-79409.rs:13:5 |
| 40 | + | |
| 41 | +LL | Box::from_raw(0 as *mut _) |
| 42 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a known size |
| 43 | + | |
| 44 | + = help: the trait `MetaSized` is not implemented for `Device` |
| 45 | +note: required by a bound in `Box` |
| 46 | + --> $SRC_DIR/alloc/src/boxed.rs:LL:COL |
| 47 | + |
| 48 | +error[E0277]: the size for values of type `Device` cannot be known |
| 49 | + --> $DIR/extern-types-unsizing-79409.rs:19:31 |
| 50 | + | |
| 51 | +LL | let d: Device = unsafe { *make_device() }; |
| 52 | + | ^^^^^^^^^^^^^ doesn't have a known size |
| 53 | + | |
| 54 | + = help: the trait `MetaSized` is not implemented for `Device` |
| 55 | +note: required by a bound in `Box` |
| 56 | + --> $SRC_DIR/alloc/src/boxed.rs:LL:COL |
| 57 | + |
| 58 | +error: aborting due to 4 previous errors; 1 warning emitted |
| 59 | + |
| 60 | +For more information about this error, try `rustc --explain E0277`. |
0 commit comments