@@ -31,10 +31,10 @@ pub use crate::intrinsics::transmute;
31
31
/// forever in an unreachable state. However, it does not guarantee that pointers
32
32
/// to this memory will remain valid.
33
33
///
34
- /// * If you want to leak memory, see [`Box::leak`][leak] .
35
- /// * If you want to obtain a raw pointer to the memory, see [`Box::into_raw`][into_raw] .
34
+ /// * If you want to leak memory, see [`Box::leak`].
35
+ /// * If you want to obtain a raw pointer to the memory, see [`Box::into_raw`].
36
36
/// * If you want to dispose of a value properly, running its destructor, see
37
- /// [`mem::drop`][drop] .
37
+ /// [`mem::drop`].
38
38
///
39
39
/// # Safety
40
40
///
@@ -132,15 +132,11 @@ pub use crate::intrinsics::transmute;
132
132
/// ownership to `s` — the final step of interacting with `v` to dispose of it without
133
133
/// running its destructor is entirely avoided.
134
134
///
135
- /// [drop]: fn.drop.html
136
- /// [uninit]: fn.uninitialized.html
137
- /// [clone]: ../clone/trait.Clone.html
138
- /// [swap]: fn.swap.html
139
- /// [box]: ../../std/boxed/struct.Box.html
140
- /// [leak]: ../../std/boxed/struct.Box.html#method.leak
141
- /// [into_raw]: ../../std/boxed/struct.Box.html#method.into_raw
135
+ /// [`Box`]: ../../std/boxed/struct.Box.html
136
+ /// [`Box::leak`]: ../../std/boxed/struct.Box.html#method.leak
137
+ /// [`Box::into_raw`]: ../../std/boxed/struct.Box.html#method.into_raw
138
+ /// [`mem::drop`]: drop
142
139
/// [ub]: ../../reference/behavior-considered-undefined.html
143
- /// [`ManuallyDrop`]: struct.ManuallyDrop.html
144
140
#[ inline]
145
141
#[ rustc_const_stable( feature = "const_forget" , since = "1.46.0" ) ]
146
142
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
@@ -152,8 +148,6 @@ pub const fn forget<T>(t: T) {
152
148
///
153
149
/// This function is just a shim intended to be removed when the `unsized_locals` feature gets
154
150
/// stabilized.
155
- ///
156
- /// [`forget`]: fn.forget.html
157
151
#[ inline]
158
152
#[ unstable( feature = "forget_unsized" , issue = "none" ) ]
159
153
pub fn forget_unsized < T : ?Sized > ( t : T ) {
@@ -301,7 +295,7 @@ pub fn forget_unsized<T: ?Sized>(t: T) {
301
295
/// assert_eq!(2, mem::size_of::<ExampleUnion>());
302
296
/// ```
303
297
///
304
- /// [alignment]: ./fn. align_of.html
298
+ /// [alignment]: align_of
305
299
#[ inline( always) ]
306
300
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
307
301
#[ rustc_promotable]
@@ -365,7 +359,6 @@ pub const fn size_of_val<T: ?Sized>(val: &T) -> usize {
365
359
/// [slice]: ../../std/primitive.slice.html
366
360
/// [trait object]: ../../book/ch17-02-trait-objects.html
367
361
/// [extern type]: ../../unstable-book/language-features/extern-types.html
368
- /// [`size_of_val`]: ../../core/mem/fn.size_of_val.html
369
362
///
370
363
/// # Examples
371
364
///
@@ -501,7 +494,6 @@ pub const fn align_of_val<T: ?Sized>(val: &T) -> usize {
501
494
/// [slice]: ../../std/primitive.slice.html
502
495
/// [trait object]: ../../book/ch17-02-trait-objects.html
503
496
/// [extern type]: ../../unstable-book/language-features/extern-types.html
504
- /// [`align_of_val`]: ../../core/mem/fn.align_of_val.html
505
497
///
506
498
/// # Examples
507
499
///
@@ -540,7 +532,7 @@ pub unsafe fn align_of_val_raw<T: ?Sized>(val: *const T) -> usize {
540
532
/// `needs_drop` explicitly. Types like [`HashMap`], on the other hand, have to drop
541
533
/// values one at a time and should use this API.
542
534
///
543
- /// [`drop_in_place`]: ../ ptr/fn. drop_in_place.html
535
+ /// [`drop_in_place`]: crate:: ptr:: drop_in_place
544
536
/// [`HashMap`]: ../../std/collections/struct.HashMap.html
545
537
///
546
538
/// # Examples
@@ -595,9 +587,9 @@ pub const fn needs_drop<T>() -> bool {
595
587
/// This has the same effect as [`MaybeUninit::zeroed().assume_init()`][zeroed].
596
588
/// It is useful for FFI sometimes, but should generally be avoided.
597
589
///
598
- /// [zeroed]: union. MaybeUninit.html#method. zeroed
590
+ /// [zeroed]: MaybeUninit:: zeroed
599
591
/// [ub]: ../../reference/behavior-considered-undefined.html
600
- /// [inv]: union. MaybeUninit.html #initialization-invariant
592
+ /// [inv]: MaybeUninit#initialization-invariant
601
593
///
602
594
/// # Examples
603
595
///
@@ -650,10 +642,10 @@ pub unsafe fn zeroed<T>() -> T {
650
642
/// (Notice that the rules around uninitialized integers are not finalized yet, but
651
643
/// until they are, it is advisable to avoid them.)
652
644
///
653
- /// [`MaybeUninit<T>`]: union. MaybeUninit.html
654
- /// [uninit]: union. MaybeUninit.html#method. uninit
655
- /// [assume_init]: union. MaybeUninit.html#method. assume_init
656
- /// [inv]: union. MaybeUninit.html #initialization-invariant
645
+ /// [`MaybeUninit<T>`]: MaybeUninit
646
+ /// [uninit]: MaybeUninit:: uninit
647
+ /// [assume_init]: MaybeUninit:: assume_init
648
+ /// [inv]: MaybeUninit#initialization-invariant
657
649
#[ inline( always) ]
658
650
#[ rustc_deprecated( since = "1.39.0" , reason = "use `mem::MaybeUninit` instead" ) ]
659
651
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
@@ -686,9 +678,6 @@ pub unsafe fn uninitialized<T>() -> T {
686
678
/// assert_eq!(42, x);
687
679
/// assert_eq!(5, y);
688
680
/// ```
689
- ///
690
- /// [`replace`]: fn.replace.html
691
- /// [`take`]: fn.take.html
692
681
#[ inline]
693
682
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
694
683
pub fn swap < T > ( x : & mut T , y : & mut T ) {
@@ -754,10 +743,6 @@ pub fn swap<T>(x: &mut T, y: &mut T) {
754
743
/// assert_eq!(buffer.get_and_reset(), vec![0, 1]);
755
744
/// assert_eq!(buffer.buf.len(), 0);
756
745
/// ```
757
- ///
758
- /// [`Clone`]: ../../std/clone/trait.Clone.html
759
- /// [`replace`]: fn.replace.html
760
- /// [`swap`]: fn.swap.html
761
746
#[ inline]
762
747
#[ stable( feature = "mem_take" , since = "1.40.0" ) ]
763
748
pub fn take < T : Default > ( dest : & mut T ) -> T {
@@ -822,10 +807,6 @@ pub fn take<T: Default>(dest: &mut T) -> T {
822
807
/// assert_eq!(buffer.replace_index(0, 2), 0);
823
808
/// assert_eq!(buffer.buf[0], 2);
824
809
/// ```
825
- ///
826
- /// [`Clone`]: ../../std/clone/trait.Clone.html
827
- /// [`swap`]: fn.swap.html
828
- /// [`take`]: fn.take.html
829
810
#[ inline]
830
811
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
831
812
#[ must_use = "if you don't need the old value, you can just assign the new value directly" ]
@@ -851,7 +832,7 @@ pub fn replace<T>(dest: &mut T, mut src: T) -> T {
851
832
/// Because `_x` is moved into the function, it is automatically dropped before
852
833
/// the function returns.
853
834
///
854
- /// [drop]: ../ops/trait. Drop.html
835
+ /// [drop]: Drop
855
836
///
856
837
/// # Examples
857
838
///
@@ -894,8 +875,7 @@ pub fn replace<T>(dest: &mut T, mut src: T) -> T {
894
875
/// println!("x: {}, y: {}", x, y.0); // still available
895
876
/// ```
896
877
///
897
- /// [`RefCell`]: ../../std/cell/struct.RefCell.html
898
- /// [`Copy`]: ../../std/marker/trait.Copy.html
878
+ /// [`RefCell`]: crate::cell::RefCell
899
879
#[ inline]
900
880
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
901
881
pub fn drop < T > ( _x : T ) { }
@@ -914,7 +894,6 @@ pub fn drop<T>(_x: T) {}
914
894
/// `T`.
915
895
///
916
896
/// [ub]: ../../reference/behavior-considered-undefined.html
917
- /// [size_of]: fn.size_of.html
918
897
///
919
898
/// # Examples
920
899
///
@@ -960,8 +939,6 @@ pub unsafe fn transmute_copy<T, U>(src: &T) -> U {
960
939
/// Opaque type representing the discriminant of an enum.
961
940
///
962
941
/// See the [`discriminant`] function in this module for more information.
963
- ///
964
- /// [`discriminant`]: fn.discriminant.html
965
942
#[ stable( feature = "discriminant_value" , since = "1.21.0" ) ]
966
943
pub struct Discriminant < T > ( <T as DiscriminantKind >:: Discriminant ) ;
967
944
0 commit comments