@@ -410,6 +410,7 @@ impl<T> Lock<T> {
410
410
411
411
#[ cfg( parallel_compiler) ]
412
412
#[ inline( always) ]
413
+ #[ track_caller]
413
414
pub fn lock ( & self ) -> LockGuard < ' _ , T > {
414
415
if ERROR_CHECKING {
415
416
self . 0 . try_lock ( ) . expect ( "lock was already held" )
@@ -420,21 +421,25 @@ impl<T> Lock<T> {
420
421
421
422
#[ cfg( not( parallel_compiler) ) ]
422
423
#[ inline( always) ]
424
+ #[ track_caller]
423
425
pub fn lock ( & self ) -> LockGuard < ' _ , T > {
424
426
self . 0 . borrow_mut ( )
425
427
}
426
428
427
429
#[ inline( always) ]
430
+ #[ track_caller]
428
431
pub fn with_lock < F : FnOnce ( & mut T ) -> R , R > ( & self , f : F ) -> R {
429
432
f ( & mut * self . lock ( ) )
430
433
}
431
434
432
435
#[ inline( always) ]
436
+ #[ track_caller]
433
437
pub fn borrow ( & self ) -> LockGuard < ' _ , T > {
434
438
self . lock ( )
435
439
}
436
440
437
441
#[ inline( always) ]
442
+ #[ track_caller]
438
443
pub fn borrow_mut ( & self ) -> LockGuard < ' _ , T > {
439
444
self . lock ( )
440
445
}
@@ -476,6 +481,7 @@ impl<T> RwLock<T> {
476
481
477
482
#[ cfg( not( parallel_compiler) ) ]
478
483
#[ inline( always) ]
484
+ #[ track_caller]
479
485
pub fn read ( & self ) -> ReadGuard < ' _ , T > {
480
486
self . 0 . borrow ( )
481
487
}
@@ -491,6 +497,7 @@ impl<T> RwLock<T> {
491
497
}
492
498
493
499
#[ inline( always) ]
500
+ #[ track_caller]
494
501
pub fn with_read_lock < F : FnOnce ( & T ) -> R , R > ( & self , f : F ) -> R {
495
502
f ( & * self . read ( ) )
496
503
}
@@ -509,6 +516,7 @@ impl<T> RwLock<T> {
509
516
510
517
#[ cfg( not( parallel_compiler) ) ]
511
518
#[ inline( always) ]
519
+ #[ track_caller]
512
520
pub fn write ( & self ) -> WriteGuard < ' _ , T > {
513
521
self . 0 . borrow_mut ( )
514
522
}
@@ -524,16 +532,19 @@ impl<T> RwLock<T> {
524
532
}
525
533
526
534
#[ inline( always) ]
535
+ #[ track_caller]
527
536
pub fn with_write_lock < F : FnOnce ( & mut T ) -> R , R > ( & self , f : F ) -> R {
528
537
f ( & mut * self . write ( ) )
529
538
}
530
539
531
540
#[ inline( always) ]
541
+ #[ track_caller]
532
542
pub fn borrow ( & self ) -> ReadGuard < ' _ , T > {
533
543
self . read ( )
534
544
}
535
545
536
546
#[ inline( always) ]
547
+ #[ track_caller]
537
548
pub fn borrow_mut ( & self ) -> WriteGuard < ' _ , T > {
538
549
self . write ( )
539
550
}
0 commit comments