2025-08-20 14:02:50 -04:00
|
|
|
// https://github.com/rust-lang/rust/issues/58212
|
2019-12-21 21:43:13 -05:00
|
|
|
//@ check-pass
|
2019-07-27 00:54:25 +03:00
|
|
|
|
2019-02-26 16:48:12 +01:00
|
|
|
trait FromUnchecked {
|
2019-12-21 21:43:13 -05:00
|
|
|
fn from_unchecked();
|
2019-02-26 16:48:12 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl FromUnchecked for [u8; 1] {
|
2019-12-21 21:43:13 -05:00
|
|
|
fn from_unchecked() {
|
|
|
|
|
let mut array: Self = [0; 1];
|
2019-02-26 16:48:12 +01:00
|
|
|
let _ptr = &mut array as *mut [u8] as *mut u8;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
|
}
|