Skip to content

Commit 52e0ff3

Browse files
committed
Switch to automatic standard library links
This removes the explicit links to the standard library. In particular, this makes it nicer to view locally since you can set SPEC_RELATIVE=0 to make the links work. There are a bunch of changes to the actual URL because rustdoc resolves re-exports to link to the original definition instead of the re-export site. From what I can tell, everything should otherwise be the same. Not all links were able to be converted due to some limitations in rustdoc, such as: - Links to rexports from std_arch don't work due to rust-lang/rust#96506. - Links to keywords aren't supported. - Links to trait impls where the trait is not in the prelude doesn't work (they must be in scope).
1 parent c53965b commit 52e0ff3

37 files changed

+69
-144
lines changed

src/attributes/codegen.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -427,9 +427,7 @@ trait object whose methods are attributed.
427427
[undefined behavior]: ../behavior-considered-undefined.md
428428
[unsafe function]: ../unsafe-keyword.md
429429
[rust-abi]: ../items/external-blocks.md#abi
430-
[`core::intrinsics::caller_location`]: ../../core/intrinsics/fn.caller_location.html
431-
[`core::panic::Location::caller`]: ../../core/panic/struct.Location.html#method.caller
432-
[`Location`]: ../../core/panic/struct.Location.html
430+
[`Location`]: core::panic::Location
433431

434432
## The `instruction_set` attribute
435433

src/attributes/derive.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ has no direct effect, but it may be used by tools and diagnostic lints to
3737
detect these automatically generated implementations.
3838

3939
[_MetaListPaths_]: ../attributes.md#meta-item-attribute-syntax
40-
[`Clone`]: ../../std/clone/trait.Clone.html
41-
[`PartialEq`]: ../../std/cmp/trait.PartialEq.html
4240
[`impl` item]: ../items/implementations.md
4341
[items]: ../items.md
4442
[derive macros]: ../procedural-macros.md#derive-macros

src/attributes/diagnostics.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,6 @@ error[E0277]: My Message for `ImportantTrait<i32>` implemented for `String`
491491
= note: Note 2
492492
```
493493

494-
[`std::fmt`]: ../../std/fmt/index.html
495494
[Clippy]: https://github.com/rust-lang/rust-clippy
496495
[_MetaListNameValueStr_]: ../attributes.md#meta-item-attribute-syntax
497496
[_MetaListPaths_]: ../attributes.md#meta-item-attribute-syntax

src/attributes/testing.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ fn mytest() {
8282

8383
[_MetaListNameValueStr_]: ../attributes.md#meta-item-attribute-syntax
8484
[_MetaNameValueStr_]: ../attributes.md#meta-item-attribute-syntax
85-
[`Termination`]: ../../std/process/trait.Termination.html
86-
[`report`]: ../../std/process/trait.Termination.html#tymethod.report
85+
[`Termination`]: std::process::Termination
86+
[`report`]: std::process::Termination::report
8787
[`test` conditional compilation option]: ../conditional-compilation.md#test
8888
[attributes]: ../attributes.md
89-
[`ExitCode`]: ../../std/process/struct.ExitCode.html
89+
[`ExitCode`]: std::process::ExitCode

src/behavior-considered-undefined.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Please read the [Rustonomicon] before writing unsafe code.
3030
* Accessing (loading from or storing to) a place that is [dangling] or [based on
3131
a misaligned pointer].
3232
* Performing a place projection that violates the requirements of [in-bounds
33-
pointer arithmetic][offset]. A place projection is a [field
33+
pointer arithmetic](pointer#method.offset). A place projection is a [field
3434
expression][project-field], a [tuple index expression][project-tuple], or an
3535
[array/slice index expression][project-slice].
3636
* Breaking the [pointer aliasing rules]. `Box<T>`, `&mut T` and `&T` follow
@@ -176,16 +176,14 @@ reading uninitialized memory is permitted are inside `union`s and in "padding"
176176
[pointer aliasing rules]: http://llvm.org/docs/LangRef.html#pointer-aliasing-rules
177177
[undef]: http://llvm.org/docs/LangRef.html#undefined-values
178178
[`target_feature`]: attributes/codegen.md#the-target_feature-attribute
179-
[`UnsafeCell<U>`]: ../std/cell/struct.UnsafeCell.html
179+
[`UnsafeCell<U>`]: std::cell::UnsafeCell
180180
[Rustonomicon]: ../nomicon/index.html
181-
[`NonNull<T>`]: ../core/ptr/struct.NonNull.html
182-
[`NonZero<T>`]: ../core/num/struct.NonZero.html
183-
[`Box<T>`]: ../alloc/boxed/struct.Box.html
181+
[`NonNull<T>`]: core::ptr::NonNull
182+
[`NonZero<T>`]: core::num::NonZero
184183
[place expression context]: expressions.md#place-expressions-and-value-expressions
185184
[rules]: inline-assembly.md#rules-for-inline-assembly
186185
[points to]: #pointed-to-bytes
187186
[pointed to]: #pointed-to-bytes
188-
[offset]: ../std/primitive.pointer.html#method.offset
189187
[project-field]: expressions/field-expr.md
190188
[project-tuple]: expressions/tuple-expr.md#tuple-indexing-expressions
191189
[project-slice]: expressions/array-expr.md#array-and-slice-indexing-expressions

src/conditional-compilation.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,6 @@ atomic loads, stores, and compare-and-swap operations.
201201
When this cfg is present, all of the stable [`core::sync::atomic`] APIs are available for
202202
the relevant atomic width.
203203

204-
[`core::sync::atomic`]: ../core/sync/atomic/index.html
205-
206204
Possible values:
207205

208206
* `"8"`
@@ -374,7 +372,6 @@ println!("I'm running on a {} machine!", machine_kind);
374372
[`cfg`]: #the-cfg-attribute
375373
[`cfg` macro]: #the-cfg-macro
376374
[`cfg_attr`]: #the-cfg_attr-attribute
377-
[`debug_assert!`]: ../std/macro.debug_assert.html
378375
[`target_feature` attribute]: attributes/codegen.md#the-target_feature-attribute
379376
[attribute]: attributes.md
380377
[attributes]: attributes.md

src/crates-and-source-files.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,14 +129,14 @@ or `_` (U+005F) characters.
129129
ECMA-335 CLI model, a *library* in the SML/NJ Compilation Manager, a *unit*
130130
in the Owens and Flatt module system, or a *configuration* in Mesa.
131131

132-
[Unicode alphanumeric]: ../std/primitive.char.html#method.is_alphanumeric
132+
[Unicode alphanumeric]: char::is_alphanumeric
133133
[`!`]: types/never.md
134134
[_InnerAttribute_]: attributes.md
135135
[_Item_]: items.md
136136
[_MetaNameValueStr_]: attributes.md#meta-item-attribute-syntax
137-
[`ExitCode`]: ../std/process/struct.ExitCode.html
138-
[`Infallible`]: ../std/convert/enum.Infallible.html
139-
[`Termination`]: ../std/process/trait.Termination.html
137+
[`ExitCode`]: std::process::ExitCode
138+
[`Infallible`]: std::convert::Infallible
139+
[`Termination`]: std::process::Termination
140140
[attribute]: attributes.md
141141
[attributes]: attributes.md
142142
[function]: items/functions.md

src/destructors.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ dropped.
88

99
The destructor of a type `T` consists of:
1010

11-
1. If `T: Drop`, calling [`<T as std::ops::Drop>::drop`]
11+
1. If `T: Drop`, calling [`<T as std::ops::Drop>::drop`](std::ops::Drop::drop)
1212
2. Recursively running the destructor of all of its fields.
1313
* The fields of a [struct] are dropped in declaration order.
1414
* The fields of the active [enum variant] are dropped in declaration order.
@@ -400,8 +400,3 @@ variable or field from being dropped automatically.
400400
[`match`]: expressions/match-expr.md
401401
[`while let`]: expressions/loop-expr.md#predicate-pattern-loops
402402
[`while`]: expressions/loop-expr.md#predicate-loops
403-
404-
[`<T as std::ops::Drop>::drop`]: ../std/ops/trait.Drop.html#tymethod.drop
405-
[`std::ptr::drop_in_place`]: ../std/ptr/fn.drop_in_place.html
406-
[`std::mem::forget`]: ../std/mem/fn.forget.html
407-
[`std::mem::ManuallyDrop`]: ../std/mem/struct.ManuallyDrop.html

src/expressions.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,6 @@ They are never allowed before:
284284
[destructors]: destructors.md
285285
[drop scope]: destructors.md#drop-scopes
286286

287-
[`Box<T>`]: ../std/boxed/struct.Box.html
288287
[`Copy`]: special-types-and-traits.md#copy
289288
[`Drop`]: special-types-and-traits.md#drop
290289
[`Sized`]: special-types-and-traits.md#sized

src/expressions/array-expr.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ arr[10]; // warning: index out of bounds
7676
The array index expression can be implemented for types other than arrays and slices by implementing the [Index] and [IndexMut] traits.
7777

7878
[`Copy`]: ../special-types-and-traits.md#copy
79-
[IndexMut]: ../../std/ops/trait.IndexMut.html
80-
[Index]: ../../std/ops/trait.Index.html
79+
[IndexMut]: std::ops::IndexMut
80+
[Index]: std::ops::Index
8181
[_Expression_]: ../expressions.md
8282
[array]: ../types/array.md
8383
[constant expression]: ../const_eval.md#constant-expressions

0 commit comments

Comments
 (0)