Skip to content

Commit 165c605

Browse files
committed
test(v2): skip stale_detection_misses_content_only_out_of_band_mutation under Miri
1 parent a5b292c commit 165c605

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

lang-v2/tests/borsh_exit_semantics.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff 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")]
110119
fn stale_detection_misses_content_only_out_of_band_mutation() {
111120
let mut buf = AccountBuffer::<256>::new();
112121
setup_counter_buf(&mut buf, 42);

0 commit comments

Comments
 (0)