mirror of
https://github.com/KaiserY/trpl-zh-cn
synced 2025-04-16 00:18:09 +08:00
14 lines
240 B
Rust
14 lines
240 B
Rust
fn main() {
|
|
// ANCHOR: here
|
|
let mut num = 5;
|
|
|
|
let r1 = &num as *const i32;
|
|
let r2 = &mut num as *mut i32;
|
|
|
|
unsafe {
|
|
println!("r1 is: {}", *r1);
|
|
println!("r2 is: {}", *r2);
|
|
}
|
|
// ANCHOR_END: here
|
|
}
|