@@ -293,11 +293,12 @@ impl<T> [T] {
293
293
/// checking.
294
294
///
295
295
/// This is generally not recommended, use with caution!
296
- /// Calling this method with an out-of-bounds index is UB even if the resulting
297
- /// reference is not used.
296
+ /// Calling this method with an out-of-bounds index is *[undefined behavior]*
297
+ /// even if the resulting reference is not used.
298
298
/// For a safe alternative see [`get`].
299
299
///
300
300
/// [`get`]: #method.get
301
+ /// [undefined behavior]: ../../reference/behavior-considered-undefined.html
301
302
///
302
303
/// # Examples
303
304
///
@@ -320,11 +321,12 @@ impl<T> [T] {
320
321
/// bounds checking.
321
322
///
322
323
/// This is generally not recommended, use with caution!
323
- /// Calling this method with an out-of-bounds index is UB even if the resulting
324
- /// reference is not used.
324
+ /// Calling this method with an out-of-bounds index is *[undefined behavior]*
325
+ /// even if the resulting reference is not used.
325
326
/// For a safe alternative see [`get_mut`].
326
327
///
327
328
/// [`get_mut`]: #method.get_mut
329
+ /// [undefined behavior]: ../../reference/behavior-considered-undefined.html
328
330
///
329
331
/// # Examples
330
332
///
@@ -2633,15 +2635,17 @@ pub trait SliceIndex<T: ?Sized>: private_slice_index::Sealed {
2633
2635
2634
2636
/// Returns a shared reference to the output at this location, without
2635
2637
/// performing any bounds checking.
2636
- /// Calling this method with an out-of-bounds index is UB even if the resulting
2637
- /// reference is not used.
2638
+ /// Calling this method with an out-of-bounds index is *[undefined behavior]*
2639
+ /// even if the resulting reference is not used.
2640
+ /// [undefined behavior]: ../../reference/behavior-considered-undefined.html
2638
2641
#[ unstable( feature = "slice_index_methods" , issue = "0" ) ]
2639
2642
unsafe fn get_unchecked ( self , slice : & T ) -> & Self :: Output ;
2640
2643
2641
2644
/// Returns a mutable reference to the output at this location, without
2642
2645
/// performing any bounds checking.
2643
- /// Calling this method with an out-of-bounds index is UB even if the resulting
2644
- /// reference is not used.
2646
+ /// Calling this method with an out-of-bounds index is *[undefined behavior]*
2647
+ /// even if the resulting reference is not used.
2648
+ /// [undefined behavior]: ../../reference/behavior-considered-undefined.html
2645
2649
#[ unstable( feature = "slice_index_methods" , issue = "0" ) ]
2646
2650
unsafe fn get_unchecked_mut ( self , slice : & mut T ) -> & mut Self :: Output ;
2647
2651
0 commit comments