Comprehensive Rust(Español) 202412block, and they are not accessed either through the references or // concurrently through any other pointers. unsafe { println!("r1 es: {}", *r1); *r1 = String::from("oh, oh"); println!("r2 es: {}", *r2); caracteres: {}", count_chars(unsafe { emojis.get_unchecked(0..7) })); // SAFETY: `abs` doesn't deal with pointers and doesn't have any safety // requirements. unsafe { println!("Valor absoluto de -3 según C: {}" (FFI). Calling external functions is usually only a problem when those functions do things with pointers which might violate Rust's memory model, but in general any C function might have undefined behaviour0 码力 | 389 页 | 1.04 MB | 10 月前3
共 1 条
- 1













