File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -107,6 +107,15 @@ fn exit_writes_modified_in_memory_state_to_guard() {
107107// (pre-mutation state) and clobbers the external change.
108108
109109#[ test]
110+ // Simulates out-of-band data mutation while `BorshAccount` holds a live
111+ // `RefMut<[u8]>` from `try_borrow_mut`. The real-world scenario (SVM host
112+ // writes during a CPI) happens outside Rust's aliasing model — no Rust
113+ // code performs the concurrent write — so Tree Borrows has no way to
114+ // represent it. The Rust-side simulation is inherently UB and Miri
115+ // correctly rejects it. Covered under regular `cargo test`.
116+ #[ cfg_attr( miri, ignore = "simulates external mutation by violating Rust's \
117+ exclusive-borrow invariant — inexpressible under Tree Borrows; covered \
118+ under cargo test") ]
110119fn stale_detection_misses_content_only_out_of_band_mutation ( ) {
111120 let mut buf = AccountBuffer :: < 256 > :: new ( ) ;
112121 setup_counter_buf ( & mut buf, 42 ) ;
You can’t perform that action at this time.
0 commit comments