Skip to content

Commit ed34f82

Browse files
authored
Rollup merge of rust-lang#77870 - camelid:intra-doc-super, r=jyn514
Use intra-doc links for links to module-level docs r? @jyn514
2 parents 31799ba + 95221b4 commit ed34f82

File tree

8 files changed

+20
-20
lines changed

8 files changed

+20
-20
lines changed

library/alloc/src/alloc.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ mod tests;
1414

1515
extern "Rust" {
1616
// These are the magic symbols to call the global allocator. rustc generates
17-
// them to call `__rg_alloc` etc if there is a `#[global_allocator]` attribute
17+
// them to call `__rg_alloc` etc. if there is a `#[global_allocator]` attribute
1818
// (the code expanding that attribute macro generates those functions), or to call
19-
// the default implementations in libstd (`__rdl_alloc` etc in `src/libstd/alloc.rs`)
19+
// the default implementations in libstd (`__rdl_alloc` etc. in `library/std/src/alloc.rs`)
2020
// otherwise.
2121
#[rustc_allocator]
2222
#[rustc_allocator_nounwind]
@@ -36,7 +36,7 @@ extern "Rust" {
3636
/// if there is one, or the `std` crate’s default.
3737
///
3838
/// Note: while this type is unstable, the functionality it provides can be
39-
/// accessed through the [free functions in `alloc`](index.html#functions).
39+
/// accessed through the [free functions in `alloc`](self#functions).
4040
#[unstable(feature = "allocator_api", issue = "32838")]
4141
#[derive(Copy, Clone, Default, Debug)]
4242
pub struct Global;

library/core/src/cell.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ use crate::ptr;
226226
/// assert_eq!(my_struct.special_field.get(), new_value);
227227
/// ```
228228
///
229-
/// See the [module-level documentation](index.html) for more.
229+
/// See the [module-level documentation](self) for more.
230230
#[stable(feature = "rust1", since = "1.0.0")]
231231
#[repr(transparent)]
232232
pub struct Cell<T: ?Sized> {
@@ -566,7 +566,7 @@ impl<T> Cell<[T]> {
566566

567567
/// A mutable memory location with dynamically checked borrow rules
568568
///
569-
/// See the [module-level documentation](index.html) for more.
569+
/// See the [module-level documentation](self) for more.
570570
#[stable(feature = "rust1", since = "1.0.0")]
571571
pub struct RefCell<T: ?Sized> {
572572
borrow: Cell<BorrowFlag>,
@@ -1203,7 +1203,7 @@ impl Clone for BorrowRef<'_> {
12031203
/// Wraps a borrowed reference to a value in a `RefCell` box.
12041204
/// A wrapper type for an immutably borrowed value from a `RefCell<T>`.
12051205
///
1206-
/// See the [module-level documentation](index.html) for more.
1206+
/// See the [module-level documentation](self) for more.
12071207
#[stable(feature = "rust1", since = "1.0.0")]
12081208
pub struct Ref<'b, T: ?Sized + 'b> {
12091209
value: &'b T,
@@ -1493,7 +1493,7 @@ impl<'b> BorrowRefMut<'b> {
14931493

14941494
/// A wrapper type for a mutably borrowed value from a `RefCell<T>`.
14951495
///
1496-
/// See the [module-level documentation](index.html) for more.
1496+
/// See the [module-level documentation](self) for more.
14971497
#[stable(feature = "rust1", since = "1.0.0")]
14981498
pub struct RefMut<'b, T: ?Sized + 'b> {
14991499
value: &'b mut T,

library/core/src/iter/sources.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -501,9 +501,9 @@ pub fn once_with<A, F: FnOnce() -> A>(gen: F) -> OnceWith<F> {
501501
///
502502
/// # Examples
503503
///
504-
/// Let’s re-implement the counter iterator from [module-level documentation]:
504+
/// Let’s re-implement the counter iterator from the [module-level documentation]:
505505
///
506-
/// [module-level documentation]: index.html
506+
/// [module-level documentation]: super
507507
///
508508
/// ```
509509
/// let mut count = 0;

library/core/src/iter/traits/collect.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ pub trait FromIterator<A>: Sized {
9494
///
9595
/// See the [module-level documentation] for more.
9696
///
97-
/// [module-level documentation]: index.html
97+
/// [module-level documentation]: crate::iter
9898
///
9999
/// # Examples
100100
///
@@ -120,7 +120,7 @@ pub trait FromIterator<A>: Sized {
120120
/// collection of some kind.
121121
///
122122
/// One benefit of implementing `IntoIterator` is that your type will [work
123-
/// with Rust's `for` loop syntax](index.html#for-loops-and-intoiterator).
123+
/// with Rust's `for` loop syntax](crate::iter#for-loops-and-intoiterator).
124124
///
125125
/// See also: [`FromIterator`].
126126
///
@@ -212,7 +212,7 @@ pub trait IntoIterator {
212212
///
213213
/// See the [module-level documentation] for more.
214214
///
215-
/// [module-level documentation]: index.html
215+
/// [module-level documentation]: crate::iter
216216
///
217217
/// # Examples
218218
///

library/core/src/iter/traits/exact_size.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@
2626
/// assert_eq!(5, five.len());
2727
/// ```
2828
///
29-
/// In the [module level docs][moddocs], we implemented an [`Iterator`],
30-
/// `Counter`. Let's implement `ExactSizeIterator` for it as well:
29+
/// In the [module-level docs], we implemented an [`Iterator`], `Counter`.
30+
/// Let's implement `ExactSizeIterator` for it as well:
3131
///
32-
/// [moddocs]: index.html
32+
/// [module-level docs]: crate::iter
3333
///
3434
/// ```
3535
/// # struct Counter {

library/core/src/result.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ use crate::{convert, fmt};
233233

234234
/// `Result` is a type that represents either success ([`Ok`]) or failure ([`Err`]).
235235
///
236-
/// See the [`std::result`](index.html) module documentation for details.
236+
/// See the [module documentation](self) for details.
237237
#[derive(Copy, PartialEq, PartialOrd, Eq, Ord, Debug, Hash)]
238238
#[must_use = "this `Result` may be an `Err` variant, which should be handled"]
239239
#[rustc_diagnostic_item = "result_type"]

library/std/src/ffi/os_str.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ use crate::sys_common::{AsInner, FromInner, IntoInner};
6969
/// [`&OsStr`]: OsStr
7070
/// [`&str`]: str
7171
/// [`CStr`]: crate::ffi::CStr
72-
/// [conversions]: index.html#conversions
72+
/// [conversions]: super#conversions
7373
#[derive(Clone)]
7474
#[stable(feature = "rust1", since = "1.0.0")]
7575
pub struct OsString {
@@ -88,7 +88,7 @@ pub struct OsString {
8888
/// the traits which `OsStr` implements for [conversions] from/to native representations.
8989
///
9090
/// [`&str`]: str
91-
/// [conversions]: index.html#conversions
91+
/// [conversions]: super#conversions
9292
#[stable(feature = "rust1", since = "1.0.0")]
9393
// FIXME:
9494
// `OsStr::from_inner` current implementation relies

library/std/src/path.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1009,7 +1009,7 @@ impl FusedIterator for Ancestors<'_> {}
10091009
/// [`set_extension`]: PathBuf::set_extension
10101010
///
10111011
/// More details about the overall approach can be found in
1012-
/// the [module documentation](index.html).
1012+
/// the [module documentation](self).
10131013
///
10141014
/// # Examples
10151015
///
@@ -1655,7 +1655,7 @@ impl AsRef<OsStr> for PathBuf {
16551655
/// see [`PathBuf`].
16561656
///
16571657
/// More details about the overall approach can be found in
1658-
/// the [module documentation](index.html).
1658+
/// the [module documentation](self).
16591659
///
16601660
/// # Examples
16611661
///

0 commit comments

Comments
 (0)