about summary refs log tree commit diff
path: root/tests/ui/extern/unsized-extern-derefmove.rs
blob: 4ec9e53f49d875c3a1cbe83e80000424afbd1488 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! Regression test for #79409

#![feature(extern_types)]

unsafe extern "C" {
    type Device;
}

unsafe fn make_device() -> Box<Device> {
    Box::from_raw(0 as *mut _)
}

fn main() {
    let d: Device = unsafe { *make_device() }; //~ERROR the size for values of type `Device` cannot be known at compilation time
}