rust/tests/ui/issues/issue-58212.rs

16 lines
240 B
Rust
Raw Normal View History

// 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() {
}