@@ -583,6 +583,7 @@ impl<T> [T] {
583
583
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
584
584
#[ rustc_const_unstable( feature = "const_swap" , issue = "83163" ) ]
585
585
#[ inline]
586
+ #[ track_caller]
586
587
pub const fn swap ( & mut self , a : usize , b : usize ) {
587
588
let _ = & self [ a] ;
588
589
let _ = & self [ b] ;
@@ -1499,6 +1500,7 @@ impl<T> [T] {
1499
1500
/// ```
1500
1501
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1501
1502
#[ inline]
1503
+ #[ track_caller]
1502
1504
pub fn split_at ( & self , mid : usize ) -> ( & [ T ] , & [ T ] ) {
1503
1505
assert ! ( mid <= self . len( ) ) ;
1504
1506
// SAFETY: `[ptr; mid]` and `[mid; len]` are inside `self`, which
@@ -1529,6 +1531,7 @@ impl<T> [T] {
1529
1531
/// ```
1530
1532
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1531
1533
#[ inline]
1534
+ #[ track_caller]
1532
1535
pub fn split_at_mut ( & mut self , mid : usize ) -> ( & mut [ T ] , & mut [ T ] ) {
1533
1536
assert ! ( mid <= self . len( ) ) ;
1534
1537
// SAFETY: `[ptr; mid]` and `[mid; len]` are inside `self`, which
@@ -1668,6 +1671,7 @@ impl<T> [T] {
1668
1671
/// ```
1669
1672
#[ unstable( feature = "split_array" , reason = "new API" , issue = "90091" ) ]
1670
1673
#[ inline]
1674
+ #[ track_caller]
1671
1675
pub fn split_array_ref < const N : usize > ( & self ) -> ( & [ T ; N ] , & [ T ] ) {
1672
1676
let ( a, b) = self . split_at ( N ) ;
1673
1677
// SAFETY: a points to [T; N]? Yes it's [T] of length N (checked by split_at)
@@ -1699,6 +1703,7 @@ impl<T> [T] {
1699
1703
/// ```
1700
1704
#[ unstable( feature = "split_array" , reason = "new API" , issue = "90091" ) ]
1701
1705
#[ inline]
1706
+ #[ track_caller]
1702
1707
pub fn split_array_mut < const N : usize > ( & mut self ) -> ( & mut [ T ; N ] , & mut [ T ] ) {
1703
1708
let ( a, b) = self . split_at_mut ( N ) ;
1704
1709
// SAFETY: a points to [T; N]? Yes it's [T] of length N (checked by split_at_mut)
0 commit comments