mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 10:45:18 +00:00
16 lines
241 B
Rust
16 lines
241 B
Rust
//@ check-pass
|
|
|
|
trait FromUnchecked {
|
|
fn from_unchecked();
|
|
}
|
|
|
|
impl FromUnchecked for [u8; 1] {
|
|
fn from_unchecked() {
|
|
let mut array: Self = [0; 1];
|
|
let _ptr = &mut array as *mut [u8] as *mut u8;
|
|
}
|
|
}
|
|
|
|
fn main() {
|
|
}
|