Skip to content

Commit 8e009bc

Browse files
Use intra-doc-links in core::ops::*
1 parent 3323691 commit 8e009bc

File tree

7 files changed

+27
-45
lines changed

7 files changed

+27
-45
lines changed

library/core/src/ops/deref.rs

-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
/// [method resolution] and [type coercions].
2929
///
3030
/// [book]: ../../book/ch15-02-deref.html
31-
/// [`DerefMut`]: trait.DerefMut.html
3231
/// [more]: #more-on-deref-coercion
3332
/// [ref-deref-op]: ../../reference/expressions/operator-expr.html#the-dereference-operator
3433
/// [method resolution]: ../../reference/expressions/method-call-expr.html
@@ -125,7 +124,6 @@ impl<T: ?Sized> Deref for &mut T {
125124
/// [method resolution] and [type coercions].
126125
///
127126
/// [book]: ../../book/ch15-02-deref.html
128-
/// [`Deref`]: trait.Deref.html
129127
/// [more]: #more-on-deref-coercion
130128
/// [ref-deref-op]: ../../reference/expressions/operator-expr.html#the-dereference-operator
131129
/// [method resolution]: ../../reference/expressions/method-call-expr.html

library/core/src/ops/drop.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@
7878
///
7979
/// In other words, if you tried to explicitly call `Drop::drop` in the above example, you'd get a compiler error.
8080
///
81-
/// If you'd like explicitly call the destructor of a value, [`std::mem::drop`] can be used instead.
81+
/// If you'd like explicitly call the destructor of a value, [`mem::drop`] can be used instead.
8282
///
83-
/// [`std::mem::drop`]: ../../std/mem/fn.drop.html
83+
/// [`mem::drop`]: crate::mem::drop
8484
///
8585
/// ## Drop order
8686
///
@@ -133,15 +133,15 @@
133133
/// hard to predict when, and how often destructors will be executed. As such,
134134
/// these types cannot have destructors.
135135
///
136-
/// [`Copy`]: ../../std/marker/trait.Copy.html
136+
/// [`Copy`]: crate::marker::Copy
137137
#[lang = "drop"]
138138
#[stable(feature = "rust1", since = "1.0.0")]
139139
pub trait Drop {
140140
/// Executes the destructor for this type.
141141
///
142142
/// This method is called implicitly when the value goes out of scope,
143143
/// and cannot be called explicitly (this is compiler error [E0040]).
144-
/// However, the [`std::mem::drop`] function in the prelude can be
144+
/// However, the [`mem::drop`] function in the prelude can be
145145
/// used to call the argument's `Drop` implementation.
146146
///
147147
/// When this method has been called, `self` has not yet been deallocated.
@@ -156,12 +156,12 @@ pub trait Drop {
156156
/// Note that even if this panics, the value is considered to be dropped;
157157
/// you must not cause `drop` to be called again. This is normally automatically
158158
/// handled by the compiler, but when using unsafe code, can sometimes occur
159-
/// unintentionally, particularly when using [`std::ptr::drop_in_place`].
159+
/// unintentionally, particularly when using [`ptr::drop_in_place`].
160160
///
161161
/// [E0040]: ../../error-index.html#E0040
162-
/// [`panic!`]: ../macro.panic.html
163-
/// [`std::mem::drop`]: ../../std/mem/fn.drop.html
164-
/// [`std::ptr::drop_in_place`]: ../../std/ptr/fn.drop_in_place.html
162+
/// [`panic!`]: crate::panic!
163+
/// [`mem::drop`]: crate::mem::drop
164+
/// [`ptr::drop_in_place`]: crate::ptr::drop_in_place
165165
#[stable(feature = "rust1", since = "1.0.0")]
166166
fn drop(&mut self);
167167
}

library/core/src/ops/function.rs

-6
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828
/// this can refer to [the relevant section in the *Rustonomicon*][nomicon].
2929
///
3030
/// [book]: ../../book/ch13-01-closures.html
31-
/// [`FnMut`]: trait.FnMut.html
32-
/// [`FnOnce`]: trait.FnOnce.html
3331
/// [function pointers]: ../../std/primitive.fn.html
3432
/// [nomicon]: ../../nomicon/hrtb.html
3533
///
@@ -99,8 +97,6 @@ pub trait Fn<Args>: FnMut<Args> {
9997
/// this can refer to [the relevant section in the *Rustonomicon*][nomicon].
10098
///
10199
/// [book]: ../../book/ch13-01-closures.html
102-
/// [`Fn`]: trait.Fn.html
103-
/// [`FnOnce`]: trait.FnOnce.html
104100
/// [function pointers]: ../../std/primitive.fn.html
105101
/// [nomicon]: ../../nomicon/hrtb.html
106102
///
@@ -180,8 +176,6 @@ pub trait FnMut<Args>: FnOnce<Args> {
180176
/// this can refer to [the relevant section in the *Rustonomicon*][nomicon].
181177
///
182178
/// [book]: ../../book/ch13-01-closures.html
183-
/// [`Fn`]: trait.Fn.html
184-
/// [`FnMut`]: trait.FnMut.html
185179
/// [function pointers]: ../../std/primitive.fn.html
186180
/// [nomicon]: ../../nomicon/hrtb.html
187181
///

library/core/src/ops/index.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
/// but only when used as an immutable value. If a mutable value is requested,
55
/// [`IndexMut`] is used instead. This allows nice things such as
66
/// `let value = v[index]` if the type of `value` implements [`Copy`].
7-
///
8-
/// [`IndexMut`]: ../../std/ops/trait.IndexMut.html
9-
/// [`Copy`]: ../../std/marker/trait.Copy.html
7+
/// [`Copy`]: crate::marker::Copy
108
///
119
/// # Examples
1210
///
@@ -76,8 +74,6 @@ pub trait Index<Idx: ?Sized> {
7674
/// an immutable value is requested, the [`Index`] trait is used instead. This
7775
/// allows nice things such as `v[index] = value`.
7876
///
79-
/// [`Index`]: ../../std/ops/trait.Index.html
80-
///
8177
/// # Examples
8278
///
8379
/// A very simple implementation of a `Balance` struct that has two sides, where

library/core/src/ops/mod.rs

+1-7
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,7 @@
133133
//! // `consume_and_return_x` can no longer be invoked at this point
134134
//! ```
135135
//!
136-
//! [`Fn`]: trait.Fn.html
137-
//! [`FnMut`]: trait.FnMut.html
138-
//! [`FnOnce`]: trait.FnOnce.html
139-
//! [`Add`]: trait.Add.html
140-
//! [`Sub`]: trait.Sub.html
141-
//! [`Mul`]: trait.Mul.html
142-
//! [`clone`]: ../clone/trait.Clone.html#tymethod.clone
136+
//! [`clone`]: crate::clone::Clone::clone
143137
//! [operator precedence]: ../../reference/expressions.html#expression-precedence
144138
145139
#![stable(feature = "rust1", since = "1.0.0")]

library/core/src/ops/range.rs

+16-16
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ use crate::hash::Hash;
3535
/// assert_eq!(arr[1..=3], [ 1,2,3 ]);
3636
/// ```
3737
///
38-
/// [`IntoIterator`]: ../iter/trait.Iterator.html
39-
/// [`Iterator`]: ../iter/trait.IntoIterator.html
40-
/// [slicing index]: ../slice/trait.SliceIndex.html
38+
/// [`IntoIterator`]: crate::iter::IntoIterator
39+
/// [`Iterator`]: crate::iter::Iterator
40+
/// [slicing index]: crate::slice::SliceIndex
4141
#[cfg_attr(not(bootstrap), lang = "RangeFull")]
4242
#[doc(alias = "..")]
4343
#[derive(Copy, Clone, Default, PartialEq, Eq, Hash)]
@@ -179,7 +179,7 @@ impl<Idx: PartialOrd<Idx>> Range<Idx> {
179179
/// assert_eq!(arr[1..=3], [ 1,2,3 ]);
180180
/// ```
181181
///
182-
/// [`Iterator`]: ../iter/trait.IntoIterator.html
182+
/// [`Iterator`]: crate::iter::IntoIterator
183183
#[cfg_attr(not(bootstrap), lang = "RangeFrom")]
184184
#[doc(alias = "..")]
185185
#[derive(Clone, PartialEq, Eq, Hash)] // not Copy -- see #27186
@@ -260,9 +260,9 @@ impl<Idx: PartialOrd<Idx>> RangeFrom<Idx> {
260260
/// assert_eq!(arr[1..=3], [ 1,2,3 ]);
261261
/// ```
262262
///
263-
/// [`IntoIterator`]: ../iter/trait.Iterator.html
264-
/// [`Iterator`]: ../iter/trait.IntoIterator.html
265-
/// [slicing index]: ../slice/trait.SliceIndex.html
263+
/// [`IntoIterator`]: crate::iter::IntoIterator
264+
/// [`Iterator`]: crate::iter::Iterator
265+
/// [slicing index]: crate::slice::SliceIndex
266266
#[cfg_attr(not(bootstrap), lang = "RangeTo")]
267267
#[doc(alias = "..")]
268268
#[derive(Copy, Clone, PartialEq, Eq, Hash)]
@@ -315,8 +315,8 @@ impl<Idx: PartialOrd<Idx>> RangeTo<Idx> {
315315
/// iteration has finished are **unspecified** other than that [`.is_empty()`]
316316
/// will return `true` once no more values will be produced.
317317
///
318-
/// [fused]: ../iter/trait.FusedIterator.html
319-
/// [`.is_empty()`]: #method.is_empty
318+
/// [fused]: crate::iter::FusedIterator
319+
/// [`.is_empty()`]: RangeInclusive::is_empty
320320
///
321321
/// # Examples
322322
///
@@ -383,8 +383,8 @@ impl<Idx> RangeInclusive<Idx> {
383383
/// Note: the value returned by this method is unspecified after the range
384384
/// has been iterated to exhaustion.
385385
///
386-
/// [`end()`]: #method.end
387-
/// [`is_empty()`]: #method.is_empty
386+
/// [`end()`]: RangeInclusive::end
387+
/// [`is_empty()`]: RangeInclusive::is_empty
388388
///
389389
/// # Examples
390390
///
@@ -408,8 +408,8 @@ impl<Idx> RangeInclusive<Idx> {
408408
/// Note: the value returned by this method is unspecified after the range
409409
/// has been iterated to exhaustion.
410410
///
411-
/// [`start()`]: #method.start
412-
/// [`is_empty()`]: #method.is_empty
411+
/// [`start()`]: RangeInclusive::start
412+
/// [`is_empty()`]: RangeInclusive::is_empty
413413
///
414414
/// # Examples
415415
///
@@ -558,9 +558,9 @@ impl<Idx: PartialOrd<Idx>> RangeInclusive<Idx> {
558558
/// assert_eq!(arr[1..=3], [ 1,2,3 ]);
559559
/// ```
560560
///
561-
/// [`IntoIterator`]: ../iter/trait.Iterator.html
562-
/// [`Iterator`]: ../iter/trait.IntoIterator.html
563-
/// [slicing index]: ../slice/trait.SliceIndex.html
561+
/// [`IntoIterator`]: crate::iter::IntoIterator
562+
/// [`Iterator`]: crate::iter::Iterator
563+
/// [slicing index]: crate::slice::SliceIndex
564564
#[cfg_attr(not(bootstrap), lang = "RangeToInclusive")]
565565
#[doc(alias = "..=")]
566566
#[derive(Copy, Clone, PartialEq, Eq, Hash)]

library/core/src/ops/unsize.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ use crate::marker::Unsize;
2929
/// pointers. It is implemented automatically by the compiler.
3030
///
3131
/// [dst-coerce]: https://github.com/rust-lang/rfcs/blob/master/text/0982-dst-coercion.md
32-
/// [unsize]: ../marker/trait.Unsize.html
32+
/// [unsize]: crate::marker::Unsize
3333
/// [nomicon-coerce]: ../../nomicon/coercions.html
3434
#[unstable(feature = "coerce_unsized", issue = "27732")]
3535
#[lang = "coerce_unsized"]

0 commit comments

Comments
 (0)