Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardRustStacked/Tree BorrowsSingle-choice MCQ

Under Stacked Borrows, what is the precise effect of creating a shared reference `&*p` from a raw pointer `p` and then later writing through `p` again, regarding the borrow stack?

let mut x = 0u8; let p: *mut u8 = &mut x; let r: &u8 = unsafe { &*p }; unsafe { *p = 1; } // (A) let _ = *r; // (B)