File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -135,7 +135,12 @@ impl LockMetadata {
135135 // instances of the same lock. Still, doing so is quite risky, a total order
136136 // must be maintained, and doing so across a set of otherwise-identical mutexes
137137 // is fraught with issues.
138- debug_assert ! ( cfg!( feature = "backtrace" ) && double_lock_self_allowed, "Tried to acquire a lock while it was held!" ) ;
138+ #[ cfg( feature = "backtrace" ) ]
139+ debug_assert ! ( double_lock_self_allowed,
140+ "Tried to acquire a lock while it was held!\n Lock constructed at {}" ,
141+ get_construction_location( & this. _lock_construction_bt) ) ;
142+ #[ cfg( not( feature = "backtrace" ) ) ]
143+ panic ! ( "Tried to acquire a lock while it was held!" ) ;
139144 }
140145 }
141146 for ( locked_idx, locked) in held. borrow ( ) . iter ( ) {
You can’t perform that action at this time.
0 commit comments