@@ -308,7 +308,7 @@ impl<T> [T] {
308
308
/// Returns a mutable reference to an element or subslice depending on the
309
309
/// type of index (see [`get`]) or `None` if the index is out of bounds.
310
310
///
311
- /// [`get`]: #method. get
311
+ /// [`get`]: slice:: get
312
312
///
313
313
/// # Examples
314
314
///
@@ -339,7 +339,7 @@ impl<T> [T] {
339
339
/// Calling this method with an out-of-bounds index is *[undefined behavior]*
340
340
/// even if the resulting reference is not used.
341
341
///
342
- /// [`get`]: #method. get
342
+ /// [`get`]: slice:: get
343
343
/// [undefined behavior]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html
344
344
///
345
345
/// # Examples
@@ -373,7 +373,7 @@ impl<T> [T] {
373
373
/// Calling this method with an out-of-bounds index is *[undefined behavior]*
374
374
/// even if the resulting reference is not used.
375
375
///
376
- /// [`get_mut`]: #method. get_mut
376
+ /// [`get_mut`]: slice:: get_mut
377
377
/// [undefined behavior]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html
378
378
///
379
379
/// # Examples
@@ -424,7 +424,7 @@ impl<T> [T] {
424
424
/// }
425
425
/// ```
426
426
///
427
- /// [`as_mut_ptr`]: #method. as_mut_ptr
427
+ /// [`as_mut_ptr`]: slice:: as_mut_ptr
428
428
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
429
429
#[ rustc_const_stable( feature = "const_slice_as_ptr" , since = "1.32.0" ) ]
430
430
#[ inline]
@@ -487,7 +487,7 @@ impl<T> [T] {
487
487
/// assert!(!a.as_ptr_range().contains(&y));
488
488
/// ```
489
489
///
490
- /// [`as_ptr`]: #method. as_ptr
490
+ /// [`as_ptr`]: slice:: as_ptr
491
491
#[ stable( feature = "slice_ptr_range" , since = "1.48.0" ) ]
492
492
#[ rustc_const_unstable( feature = "const_ptr_offset" , issue = "71499" ) ]
493
493
#[ inline]
@@ -529,7 +529,7 @@ impl<T> [T] {
529
529
/// use two pointers to refer to a range of elements in memory, as is
530
530
/// common in C++.
531
531
///
532
- /// [`as_mut_ptr`]: #method. as_mut_ptr
532
+ /// [`as_mut_ptr`]: slice:: as_mut_ptr
533
533
#[ stable( feature = "slice_ptr_range" , since = "1.48.0" ) ]
534
534
#[ rustc_const_unstable( feature = "const_ptr_offset" , issue = "71499" ) ]
535
535
#[ inline]
@@ -780,8 +780,8 @@ impl<T> [T] {
780
780
/// assert!(iter.next().is_none());
781
781
/// ```
782
782
///
783
- /// [`chunks_exact`]: #method. chunks_exact
784
- /// [`rchunks`]: #method. rchunks
783
+ /// [`chunks_exact`]: slice:: chunks_exact
784
+ /// [`rchunks`]: slice:: rchunks
785
785
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
786
786
#[ inline]
787
787
pub fn chunks ( & self , chunk_size : usize ) -> Chunks < ' _ , T > {
@@ -818,8 +818,8 @@ impl<T> [T] {
818
818
/// assert_eq!(v, &[1, 1, 2, 2, 3]);
819
819
/// ```
820
820
///
821
- /// [`chunks_exact_mut`]: #method. chunks_exact_mut
822
- /// [`rchunks_mut`]: #method. rchunks_mut
821
+ /// [`chunks_exact_mut`]: slice:: chunks_exact_mut
822
+ /// [`rchunks_mut`]: slice:: rchunks_mut
823
823
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
824
824
#[ inline]
825
825
pub fn chunks_mut ( & mut self , chunk_size : usize ) -> ChunksMut < ' _ , T > {
@@ -855,8 +855,8 @@ impl<T> [T] {
855
855
/// assert_eq!(iter.remainder(), &['m']);
856
856
/// ```
857
857
///
858
- /// [`chunks`]: #method. chunks
859
- /// [`rchunks_exact`]: #method. rchunks_exact
858
+ /// [`chunks`]: slice:: chunks
859
+ /// [`rchunks_exact`]: slice:: rchunks_exact
860
860
#[ stable( feature = "chunks_exact" , since = "1.31.0" ) ]
861
861
#[ inline]
862
862
pub fn chunks_exact ( & self , chunk_size : usize ) -> ChunksExact < ' _ , T > {
@@ -897,8 +897,8 @@ impl<T> [T] {
897
897
/// assert_eq!(v, &[1, 1, 2, 2, 0]);
898
898
/// ```
899
899
///
900
- /// [`chunks_mut`]: #method. chunks_mut
901
- /// [`rchunks_exact_mut`]: #method. rchunks_exact_mut
900
+ /// [`chunks_mut`]: slice:: chunks_mut
901
+ /// [`rchunks_exact_mut`]: slice:: rchunks_exact_mut
902
902
#[ stable( feature = "chunks_exact" , since = "1.31.0" ) ]
903
903
#[ inline]
904
904
pub fn chunks_exact_mut ( & mut self , chunk_size : usize ) -> ChunksExactMut < ' _ , T > {
@@ -1032,7 +1032,7 @@ impl<T> [T] {
1032
1032
/// assert_eq!(iter.remainder(), &['m']);
1033
1033
/// ```
1034
1034
///
1035
- /// [`chunks_exact`]: #method. chunks_exact
1035
+ /// [`chunks_exact`]: slice:: chunks_exact
1036
1036
#[ unstable( feature = "array_chunks" , issue = "74985" ) ]
1037
1037
#[ inline]
1038
1038
pub fn array_chunks < const N : usize > ( & self ) -> ArrayChunks < ' _ , T , N > {
@@ -1182,7 +1182,7 @@ impl<T> [T] {
1182
1182
/// assert_eq!(v, &[1, 1, 2, 2, 0]);
1183
1183
/// ```
1184
1184
///
1185
- /// [`chunks_exact_mut`]: #method. chunks_exact_mut
1185
+ /// [`chunks_exact_mut`]: slice:: chunks_exact_mut
1186
1186
#[ unstable( feature = "array_chunks" , issue = "74985" ) ]
1187
1187
#[ inline]
1188
1188
pub fn array_chunks_mut < const N : usize > ( & mut self ) -> ArrayChunksMut < ' _ , T , N > {
@@ -1214,7 +1214,7 @@ impl<T> [T] {
1214
1214
/// assert!(iter.next().is_none());
1215
1215
/// ```
1216
1216
///
1217
- /// [`windows`]: #method. windows
1217
+ /// [`windows`]: slice:: windows
1218
1218
#[ unstable( feature = "array_windows" , issue = "75027" ) ]
1219
1219
#[ inline]
1220
1220
pub fn array_windows < const N : usize > ( & self ) -> ArrayWindows < ' _ , T , N > {
@@ -1247,8 +1247,8 @@ impl<T> [T] {
1247
1247
/// assert!(iter.next().is_none());
1248
1248
/// ```
1249
1249
///
1250
- /// [`rchunks_exact`]: #method. rchunks_exact
1251
- /// [`chunks`]: #method. chunks
1250
+ /// [`rchunks_exact`]: slice:: rchunks_exact
1251
+ /// [`chunks`]: slice:: chunks
1252
1252
#[ stable( feature = "rchunks" , since = "1.31.0" ) ]
1253
1253
#[ inline]
1254
1254
pub fn rchunks ( & self , chunk_size : usize ) -> RChunks < ' _ , T > {
@@ -1285,8 +1285,8 @@ impl<T> [T] {
1285
1285
/// assert_eq!(v, &[3, 2, 2, 1, 1]);
1286
1286
/// ```
1287
1287
///
1288
- /// [`rchunks_exact_mut`]: #method. rchunks_exact_mut
1289
- /// [`chunks_mut`]: #method. chunks_mut
1288
+ /// [`rchunks_exact_mut`]: slice:: rchunks_exact_mut
1289
+ /// [`chunks_mut`]: slice:: chunks_mut
1290
1290
#[ stable( feature = "rchunks" , since = "1.31.0" ) ]
1291
1291
#[ inline]
1292
1292
pub fn rchunks_mut ( & mut self , chunk_size : usize ) -> RChunksMut < ' _ , T > {
@@ -1323,9 +1323,9 @@ impl<T> [T] {
1323
1323
/// assert_eq!(iter.remainder(), &['l']);
1324
1324
/// ```
1325
1325
///
1326
- /// [`chunks`]: #method. chunks
1327
- /// [`rchunks`]: #method. rchunks
1328
- /// [`chunks_exact`]: #method. chunks_exact
1326
+ /// [`chunks`]: slice:: chunks
1327
+ /// [`rchunks`]: slice:: rchunks
1328
+ /// [`chunks_exact`]: slice:: chunks_exact
1329
1329
#[ stable( feature = "rchunks" , since = "1.31.0" ) ]
1330
1330
#[ inline]
1331
1331
pub fn rchunks_exact ( & self , chunk_size : usize ) -> RChunksExact < ' _ , T > {
@@ -1366,9 +1366,9 @@ impl<T> [T] {
1366
1366
/// assert_eq!(v, &[0, 2, 2, 1, 1]);
1367
1367
/// ```
1368
1368
///
1369
- /// [`chunks_mut`]: #method. chunks_mut
1370
- /// [`rchunks_mut`]: #method. rchunks_mut
1371
- /// [`chunks_exact_mut`]: #method. chunks_exact_mut
1369
+ /// [`chunks_mut`]: slice:: chunks_mut
1370
+ /// [`rchunks_mut`]: slice:: rchunks_mut
1371
+ /// [`chunks_exact_mut`]: slice:: chunks_exact_mut
1372
1372
#[ stable( feature = "rchunks" , since = "1.31.0" ) ]
1373
1373
#[ inline]
1374
1374
pub fn rchunks_exact_mut ( & mut self , chunk_size : usize ) -> RChunksExactMut < ' _ , T > {
@@ -1552,7 +1552,7 @@ impl<T> [T] {
1552
1552
/// even if the resulting reference is not used. The caller has to ensure that
1553
1553
/// `0 <= mid <= self.len()`.
1554
1554
///
1555
- /// [`split_at`]: #method. split_at
1555
+ /// [`split_at`]: slice:: split_at
1556
1556
/// [undefined behavior]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html
1557
1557
///
1558
1558
/// # Examples
@@ -1601,7 +1601,7 @@ impl<T> [T] {
1601
1601
/// even if the resulting reference is not used. The caller has to ensure that
1602
1602
/// `0 <= mid <= self.len()`.
1603
1603
///
1604
- /// [`split_at_mut`]: #method. split_at_mut
1604
+ /// [`split_at_mut`]: slice:: split_at_mut
1605
1605
/// [undefined behavior]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html
1606
1606
///
1607
1607
/// # Examples
@@ -2103,9 +2103,9 @@ impl<T> [T] {
2103
2103
///
2104
2104
/// See also [`binary_search_by`], [`binary_search_by_key`], and [`partition_point`].
2105
2105
///
2106
- /// [`binary_search_by`]: #method. binary_search_by
2107
- /// [`binary_search_by_key`]: #method. binary_search_by_key
2108
- /// [`partition_point`]: #method. partition_point
2106
+ /// [`binary_search_by`]: slice:: binary_search_by
2107
+ /// [`binary_search_by_key`]: slice:: binary_search_by_key
2108
+ /// [`partition_point`]: slice:: partition_point
2109
2109
///
2110
2110
/// # Examples
2111
2111
///
@@ -2156,9 +2156,9 @@ impl<T> [T] {
2156
2156
///
2157
2157
/// See also [`binary_search`], [`binary_search_by_key`], and [`partition_point`].
2158
2158
///
2159
- /// [`binary_search`]: #method. binary_search
2160
- /// [`binary_search_by_key`]: #method. binary_search_by_key
2161
- /// [`partition_point`]: #method. partition_point
2159
+ /// [`binary_search`]: slice:: binary_search
2160
+ /// [`binary_search_by_key`]: slice:: binary_search_by_key
2161
+ /// [`partition_point`]: slice:: partition_point
2162
2162
///
2163
2163
/// # Examples
2164
2164
///
@@ -2225,10 +2225,10 @@ impl<T> [T] {
2225
2225
///
2226
2226
/// See also [`binary_search`], [`binary_search_by`], and [`partition_point`].
2227
2227
///
2228
- /// [`sort_by_key`]: #method. sort_by_key
2229
- /// [`binary_search`]: #method. binary_search
2230
- /// [`binary_search_by`]: #method. binary_search_by
2231
- /// [`partition_point`]: #method. partition_point
2228
+ /// [`sort_by_key`]: slice:: sort_by_key
2229
+ /// [`binary_search`]: slice:: binary_search
2230
+ /// [`binary_search_by`]: slice:: binary_search_by
2231
+ /// [`partition_point`]: slice:: partition_point
2232
2232
///
2233
2233
/// # Examples
2234
2234
///
@@ -2248,6 +2248,12 @@ impl<T> [T] {
2248
2248
/// let r = s.binary_search_by_key(&1, |&(a, b)| b);
2249
2249
/// assert!(match r { Ok(1..=4) => true, _ => false, });
2250
2250
/// ```
2251
+ // Lint rustdoc::broken_intra_doc_links is allowed as `slice::sort_by_key` is
2252
+ // in crate `alloc`, and as such doesn't exists yet when building `core`.
2253
+ // links to downstream crate: #74481. Since primitives are only documented in
2254
+ // libstd (#73423), this never leads to broken links in practice.
2255
+ #[ cfg_attr( not( bootstrap) , allow( rustdoc:: broken_intra_doc_links) ) ]
2256
+ #[ cfg_attr( bootstrap, allow( broken_intra_doc_links) ) ]
2251
2257
#[ stable( feature = "slice_binary_search_by_key" , since = "1.10.0" ) ]
2252
2258
#[ inline]
2253
2259
pub fn binary_search_by_key < ' a , B , F > ( & ' a self , b : & B , mut f : F ) -> Result < usize , usize >
@@ -2446,7 +2452,7 @@ impl<T> [T] {
2446
2452
/// The current algorithm is based on the quickselect portion of the same quicksort algorithm
2447
2453
/// used for [`sort_unstable`].
2448
2454
///
2449
- /// [`sort_unstable`]: #method. sort_unstable
2455
+ /// [`sort_unstable`]: slice:: sort_unstable
2450
2456
///
2451
2457
/// # Panics
2452
2458
///
@@ -2494,7 +2500,7 @@ impl<T> [T] {
2494
2500
/// The current algorithm is based on the quickselect portion of the same quicksort algorithm
2495
2501
/// used for [`sort_unstable`].
2496
2502
///
2497
- /// [`sort_unstable`]: #method. sort_unstable
2503
+ /// [`sort_unstable`]: slice:: sort_unstable
2498
2504
///
2499
2505
/// # Panics
2500
2506
///
@@ -2546,7 +2552,7 @@ impl<T> [T] {
2546
2552
/// The current algorithm is based on the quickselect portion of the same quicksort algorithm
2547
2553
/// used for [`sort_unstable`].
2548
2554
///
2549
- /// [`sort_unstable`]: #method. sort_unstable
2555
+ /// [`sort_unstable`]: slice:: sort_unstable
2550
2556
///
2551
2557
/// # Panics
2552
2558
///
@@ -2883,7 +2889,7 @@ impl<T> [T] {
2883
2889
/// trait to generate values, you can pass [`Default::default`] as the
2884
2890
/// argument.
2885
2891
///
2886
- /// [`fill`]: #method. fill
2892
+ /// [`fill`]: slice:: fill
2887
2893
///
2888
2894
/// # Examples
2889
2895
///
@@ -2956,8 +2962,8 @@ impl<T> [T] {
2956
2962
/// assert_eq!(slice, [4, 5, 3, 4, 5]);
2957
2963
/// ```
2958
2964
///
2959
- /// [`copy_from_slice`]: #method. copy_from_slice
2960
- /// [`split_at_mut`]: #method. split_at_mut
2965
+ /// [`copy_from_slice`]: slice:: copy_from_slice
2966
+ /// [`split_at_mut`]: slice:: split_at_mut
2961
2967
#[ stable( feature = "clone_from_slice" , since = "1.7.0" ) ]
2962
2968
pub fn clone_from_slice ( & mut self , src : & [ T ] )
2963
2969
where
@@ -3018,8 +3024,8 @@ impl<T> [T] {
3018
3024
/// assert_eq!(slice, [4, 5, 3, 4, 5]);
3019
3025
/// ```
3020
3026
///
3021
- /// [`clone_from_slice`]: #method. clone_from_slice
3022
- /// [`split_at_mut`]: #method. split_at_mut
3027
+ /// [`clone_from_slice`]: slice:: clone_from_slice
3028
+ /// [`split_at_mut`]: slice:: split_at_mut
3023
3029
#[ doc( alias = "memcpy" ) ]
3024
3030
#[ stable( feature = "copy_from_slice" , since = "1.9.0" ) ]
3025
3031
pub fn copy_from_slice ( & mut self , src : & [ T ] )
@@ -3136,7 +3142,7 @@ impl<T> [T] {
3136
3142
/// assert_eq!(slice, [4, 5, 3, 1, 2]);
3137
3143
/// ```
3138
3144
///
3139
- /// [`split_at_mut`]: #method. split_at_mut
3145
+ /// [`split_at_mut`]: slice:: split_at_mut
3140
3146
#[ stable( feature = "swap_with_slice" , since = "1.27.0" ) ]
3141
3147
pub fn swap_with_slice ( & mut self , other : & mut [ T ] ) {
3142
3148
assert ! ( self . len( ) == other. len( ) , "destination and source slices have different lengths" ) ;
@@ -3380,7 +3386,7 @@ impl<T> [T] {
3380
3386
/// function to determine the ordering of two elements. Apart from that, it's equivalent to
3381
3387
/// [`is_sorted`]; see its documentation for more information.
3382
3388
///
3383
- /// [`is_sorted`]: #method. is_sorted
3389
+ /// [`is_sorted`]: slice:: is_sorted
3384
3390
#[ unstable( feature = "is_sorted" , reason = "new API" , issue = "53485" ) ]
3385
3391
pub fn is_sorted_by < F > ( & self , mut compare : F ) -> bool
3386
3392
where
@@ -3395,7 +3401,7 @@ impl<T> [T] {
3395
3401
/// elements, as determined by `f`. Apart from that, it's equivalent to [`is_sorted`]; see its
3396
3402
/// documentation for more information.
3397
3403
///
3398
- /// [`is_sorted`]: #method. is_sorted
3404
+ /// [`is_sorted`]: slice:: is_sorted
3399
3405
///
3400
3406
/// # Examples
3401
3407
///
@@ -3429,9 +3435,9 @@ impl<T> [T] {
3429
3435
///
3430
3436
/// See also [`binary_search`], [`binary_search_by`], and [`binary_search_by_key`].
3431
3437
///
3432
- /// [`binary_search`]: #method. binary_search
3433
- /// [`binary_search_by`]: #method. binary_search_by
3434
- /// [`binary_search_by_key`]: #method. binary_search_by_key
3438
+ /// [`binary_search`]: slice:: binary_search
3439
+ /// [`binary_search_by`]: slice:: binary_search_by
3440
+ /// [`binary_search_by_key`]: slice:: binary_search_by_key
3435
3441
///
3436
3442
/// # Examples
3437
3443
///
0 commit comments