mirror of https://github.com/KaiserY/trpl-zh-cn
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
11 lines
217 B
11 lines
217 B
3 years ago
|
fn main() {
|
||
|
// ANCHOR: here
|
||
|
use std::slice;
|
||
|
|
||
|
let address = 0x01234usize;
|
||
|
let r = address as *mut i32;
|
||
|
|
||
|
let slice: &[i32] = unsafe { slice::from_raw_parts_mut(r, 10000) };
|
||
|
// ANCHOR_END: here
|
||
|
}
|