Skip to content

Commit

Permalink
fn check_overlaps: Add an example in a comment.
Browse files Browse the repository at this point in the history
  • Loading branch information
kkysen committed Apr 13, 2024
1 parent a2fc825 commit 5013571
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/disjoint_mut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,12 @@ mod debug {
let current_thread = thread::current().id();
let [current_mutable, existing_mutable] =
[current_mutable, existing_mutable].map(|mutable| if mutable { "&mut" } else { "&" });
// Example:
//
// &mut _[0..8] on ThreadId(3) overlaps with existing &mut _[0..8] on ThreadId(2):
// stack backtrace:
// 0: rav1d::src::disjoint_mut::debug::DisjointMutBounds::new
// at ./src/disjoint_mut.rs:443:28
panic!("{current_mutable} _[{current_bounds}] on {current_thread:?} overlaps with existing {existing_mutable} _[{existing_bounds}] on {existing_thread:?}:\nstack backtrace:\n{existing_backtrace}");
}

Expand Down

0 comments on commit 5013571

Please sign in to comment.