Use raw pointers in Rust by declaring them as *const T or *mut T inside an unsafe block to bypass the borrow checker. Raw pointers do not own data and must be explicitly dereferenced with * or converted to safe references using & or &mut within unsafe code.
fn main() {
let mut num = 5;
let r1 = &num as *const i32;
let r2 = &mut num as *mut i32;
unsafe {
println!("r1: {}", *r1);
*r2 += 1;
println!("r2: {}", *r2);
}
}