Skip to content

Commit 3eb8434

Browse files
committed
Get linkchecker clean
This affects the book, some missed things in the reference, the grammar, and the standard library. Whew!
1 parent 4305b67 commit 3eb8434

15 files changed

+49
-46
lines changed

src/doc/book/src/attributes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,4 @@ Rust attributes are used for a number of different things. There is a full list
6767
of attributes [in the reference][reference]. Currently, you are not allowed to
6868
create your own attributes, the Rust compiler defines them.
6969

70-
[reference]: ../reference.html#attributes
70+
[reference]: ../reference/attributes.html

src/doc/book/src/compiler-plugins.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ The advantages over a simple `fn(&str) -> u32` are:
119119
a way to define new literal syntax for any data type.
120120

121121
In addition to procedural macros, you can define new
122-
[`derive`](../reference.html#derive)-like attributes and other kinds of
122+
[`derive`](../reference/attributes.html#derive)-like attributes and other kinds of
123123
extensions. See `Registry::register_syntax_extension` and the `SyntaxExtension`
124124
enum. For a more involved macro example, see
125125
[`regex_macros`](https://github.com/rust-lang/regex/blob/master/regex_macros/src/lib.rs).
@@ -165,8 +165,8 @@ quasiquote as an ordinary plugin library.
165165
# Lint plugins
166166

167167
Plugins can extend [Rust's lint
168-
infrastructure](../reference.html#lint-check-attributes) with additional checks for
169-
code style, safety, etc. Now let's write a plugin
168+
infrastructure](../reference/attributes.html#lint-check-attributes) with
169+
additional checks for code style, safety, etc. Now let's write a plugin
170170
[`lint_plugin_test.rs`](https://github.com/rust-lang/rust/blob/master/src/test/run-pass-fulldeps/auxiliary/lint_plugin_test.rs)
171171
that warns about any item named `lintme`.
172172

@@ -244,9 +244,10 @@ mostly use the same infrastructure as lint plugins, and provide examples of how
244244
to access type information.
245245

246246
Lints defined by plugins are controlled by the usual [attributes and compiler
247-
flags](../reference.html#lint-check-attributes), e.g. `#[allow(test_lint)]` or
248-
`-A test-lint`. These identifiers are derived from the first argument to
249-
`declare_lint!`, with appropriate case and punctuation conversion.
247+
flags](../reference/attributes.html#lint-check-attributes), e.g.
248+
`#[allow(test_lint)]` or `-A test-lint`. These identifiers are derived from the
249+
first argument to `declare_lint!`, with appropriate case and punctuation
250+
conversion.
250251

251252
You can run `rustc -W help foo.rs` to see a list of lints known to `rustc`,
252253
including those provided by plugins loaded by `foo.rs`.

src/doc/book/src/macros.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ trees, at compile time. The semicolon is optional on the last (here, only)
101101
case. The "pattern" on the left-hand side of `=>` is known as a ‘matcher’.
102102
These have [their own little grammar] within the language.
103103

104-
[their own little grammar]: ../reference.html#macros
104+
[their own little grammar]: ../reference/macros.html
105105

106106
The matcher `$x:expr` will match any Rust expression, binding that syntax tree
107107
to the ‘metavariable’ `$x`. The identifier `expr` is a ‘fragment specifier’;
@@ -363,7 +363,7 @@ fn main() {
363363
}
364364
```
365365

366-
[items]: ../reference.html#items
366+
[items]: ../reference/items.html
367367

368368
# Recursive macros
369369

@@ -490,7 +490,7 @@ be forced to choose between parsing `$i` and parsing `$e`. Changing the
490490
invocation syntax to put a distinctive token in front can solve the problem. In
491491
this case, you can write `$(I $i:ident)* E $e:expr`.
492492

493-
[item]: ../reference.html#items
493+
[item]: ../reference/items.html
494494

495495
# Scoping and macro import/export
496496

@@ -565,7 +565,7 @@ When this library is loaded with `#[macro_use] extern crate`, only `m2` will
565565
be imported.
566566

567567
The Rust Reference has a [listing of macro-related
568-
attributes](../reference.html#macro-related-attributes).
568+
attributes](../reference/attributes.html#macro-related-attributes).
569569

570570
# The variable `$crate`
571571

src/doc/book/src/syntax-index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -235,10 +235,10 @@
235235
[Primitive Types (Tuple Indexing)]: primitive-types.html#tuple-indexing
236236
[Primitive Types (Tuples)]: primitive-types.html#tuples
237237
[Raw Pointers]: raw-pointers.html
238-
[Reference (Byte String Literals)]: ../reference.html#byte-string-literals
239-
[Reference (Integer literals)]: ../reference.html#integer-literals
240-
[Reference (Raw Byte String Literals)]: ../reference.html#raw-byte-string-literals
241-
[Reference (Raw String Literals)]: ../reference.html#raw-string-literals
238+
[Reference (Byte String Literals)]: ../reference/tokens.html/#byte-string-literals
239+
[Reference (Integer literals)]: ../reference/tokens.html#integer-literals
240+
[Reference (Raw Byte String Literals)]: ../reference/tokens.html#raw-byte-string-literals
241+
[Reference (Raw String Literals)]: ../reference/tokens.html#raw-string-literals
242242
[References and Borrowing]: references-and-borrowing.html
243243
[Strings]: strings.html
244244
[Structs (Update syntax)]: structs.html#update-syntax

src/doc/grammar.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ literal : [ string_lit | char_lit | byte_string_lit | byte_lit | num_lit | bool_
187187
The optional `lit_suffix` production is only used for certain numeric literals,
188188
but is reserved for future extension. That is, the above gives the lexical
189189
grammar, but a Rust parser will reject everything but the 12 special cases
190-
mentioned in [Number literals](reference.html#number-literals) in the
190+
mentioned in [Number literals](reference/tokens.html#number-literals) in the
191191
reference.
192192

193193
#### Character and string literals

src/doc/reference/src/attributes.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ type int8_t = i8;
4646
## Crate-only attributes
4747

4848
- `crate_name` - specify the crate's crate name.
49-
- `crate_type` - see [linkage](#linkage).
49+
- `crate_type` - see [linkage](linkage.html).
5050
- `feature` - see [compiler features](#compiler-features).
5151
- `no_builtins` - disable optimizing certain code patterns to invocations of
5252
library functions that are assumed to exist
@@ -106,7 +106,7 @@ On an `extern` block, the following attributes are interpreted:
106106
- `link` - indicate that a native library should be linked to for the
107107
declarations in this block to be linked correctly. `link` supports an optional
108108
`kind` key with three possible values: `dylib`, `static`, and `framework`. See
109-
[external blocks](#external-blocks) for more about external blocks. Two
109+
[external blocks](items.html#external-blocks) for more about external blocks. Two
110110
examples: `#[link(name = "readline")]` and
111111
`#[link(name = "CoreFoundation", kind = "framework")]`.
112112
- `linked_from` - indicates what native library this block of FFI items is
@@ -149,7 +149,7 @@ On `struct`s:
149149
list of names `#[macro_use(foo, bar)]` restricts the import to just those
150150
macros named. The `extern crate` must appear at the crate root, not inside
151151
`mod`, which ensures proper function of the [`$crate` macro
152-
variable](book/macros.html#The%20variable%20%24crate).
152+
variable](../book/macros.html#the-variable-crate).
153153

154154
- `macro_reexport` on an `extern crate` — re-export the named macros.
155155

@@ -159,7 +159,7 @@ On `struct`s:
159159
link it into the output.
160160

161161
See the [macros section of the
162-
book](book/macros.html#Scoping%20and%20macro%20import%2Fexport) for more information on
162+
book](../book/macros.html#scoping-and-macro-importexport) for more information on
163163
macro scope.
164164

165165
## Miscellaneous attributes
@@ -317,7 +317,8 @@ For any lint check `C`:
317317

318318
The lint checks supported by the compiler can be found via `rustc -W help`,
319319
along with their default settings. [Compiler
320-
plugins](book/compiler-plugins.html#lint-plugins) can provide additional lint checks.
320+
plugins](../book/compiler-plugins.html#lint-plugins) can provide additional
321+
lint checks.
321322

322323
```{.ignore}
323324
pub mod m1 {
@@ -442,7 +443,7 @@ impl<T: PartialEq> PartialEq for Foo<T> {
442443
```
443444

444445
You can implement `derive` for your own type through [procedural
445-
macros](#procedural-macros).
446+
macros](procedural-macros.html).
446447

447448
### Compiler Features
448449

@@ -464,10 +465,10 @@ considered off, and using the features will result in a compiler error.
464465

465466
The currently implemented features of the reference compiler are:
466467

467-
* `advanced_slice_patterns` - See the [match expressions](#match-expressions)
468-
section for discussion; the exact semantics of
469-
slice patterns are subject to change, so some types
470-
are still unstable.
468+
* `advanced_slice_patterns` - See the [match
469+
expressions](expressions.html#match-expressions)
470+
section for discussion; the exact semantics of
471+
slice patterns are subject to change, so some types are still unstable.
471472

472473
* `slice_patterns` - OK, actually, slice patterns are just scary and
473474
completely unstable.

src/doc/reference/src/expressions.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ be copied if its type implements `Copy`. All others are moved.
8585

8686
## Literal expressions
8787

88-
A _literal expression_ consists of one of the [literal](tokens.md#literals) forms
88+
A _literal expression_ consists of one of the [literal](tokens.html#literals) forms
8989
described earlier. It directly describes a number, character, string, boolean
9090
value, or the unit value.
9191

@@ -124,19 +124,19 @@ comma:
124124
## Struct expressions
125125

126126
There are several forms of struct expressions. A _struct expression_
127-
consists of the [path](#paths) of a [struct item](items.html#structs), followed
127+
consists of the [path](paths.html) of a [struct item](items.html#structs), followed
128128
by a brace-enclosed list of zero or more comma-separated name-value pairs,
129129
providing the field values of a new instance of the struct. A field name can be
130130
any identifier, and is separated from its value expression by a colon. The
131131
location denoted by a struct field is mutable if and only if the enclosing
132132
struct is mutable.
133133

134-
A _tuple struct expression_ consists of the [path](#paths) of a [struct
134+
A _tuple struct expression_ consists of the [path](paths.html) of a [struct
135135
item](items.html#structs), followed by a parenthesized list of one or more
136136
comma-separated expressions (in other words, the path of a struct item followed
137137
by a tuple expression). The struct item must be a tuple struct item.
138138

139-
A _unit-like struct expression_ consists only of the [path](#paths) of a
139+
A _unit-like struct expression_ consists only of the [path](paths.html) of a
140140
[struct item](items.html#structs).
141141

142142
The following are examples of struct expressions:
@@ -217,7 +217,8 @@ A _method call_ consists of an expression followed by a single dot, an
217217
identifier, and a parenthesized expression-list. Method calls are resolved to
218218
methods on specific traits, either statically dispatching to a method if the
219219
exact `self`-type of the left-hand-side is known, or dynamically dispatching if
220-
the left-hand-side expression is an indirect [trait object](trait-objects.html).
220+
the left-hand-side expression is an indirect [trait
221+
object](types.html#trait-objects).
221222

222223
## Field expressions
223224

@@ -504,7 +505,7 @@ The `+`, `-`, `*`, `/`, `%`, `&`, `|`, `^`, `<<`, and `>>` operators may be
504505
composed with the `=` operator. The expression `lval OP= val` is equivalent to
505506
`lval = lval OP val`. For example, `x = x + 1` may be written as `x += 1`.
506507

507-
Any such expression always has the [`unit`](#tuple-types) type.
508+
Any such expression always has the [`unit`](types.html#tuple-types) type.
508509

509510
### Operator precedence
510511

src/doc/reference/src/identifiers.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ Or
1313
* The identifier is more than one character, `_` alone is not an identifier
1414
* The remaining characters have property `XID_continue`
1515

16-
that does _not_ occur in the set of [keywords][keywords].
16+
that does _not_ occur in the set of [keywords].
1717

1818
> **Note**: `XID_start` and `XID_continue` as character properties cover the
1919
> character ranges used to form the more familiar C and Java language-family
2020
> identifiers.
2121
22-
keywords: ../grammar.html#keywords
22+
[keywords]: ../grammar.html#keywords
2323
[^non_ascii_idents]: Non-ASCII characters in identifiers are currently feature
24-
gated. This is expected to improve soon.
24+
gated. This is expected to improve soon.

src/doc/reference/src/items.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ nested set of [modules]. Every crate has a single "outermost"
55
anonymous module; all further items within the crate have [paths]
66
within the module tree of the crate.
77

8-
[modules]: modules.html
8+
[modules]: #modules
99
[paths]: paths.html
1010

1111
Items are entirely determined at compile-time, generally remain fixed during

src/libcore/intrinsics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@ extern "rust-intrinsic" {
687687
/// The [nomicon](../../nomicon/transmutes.html) has additional
688688
/// documentation.
689689
///
690-
/// [ub]: ../../reference.html#behavior-considered-undefined
690+
/// [ub]: ../../reference/behavior-considered-undefined.html
691691
///
692692
/// # Examples
693693
///

src/libcore/marker.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ use hash::Hasher;
3636
///
3737
/// [`Rc`]: ../../std/rc/struct.Rc.html
3838
/// [arc]: ../../std/sync/struct.Arc.html
39-
/// [ub]: ../../reference.html#behavior-considered-undefined
39+
/// [ub]: ../../reference/behavior-considered-undefined.html
4040
#[stable(feature = "rust1", since = "1.0.0")]
4141
#[lang = "send"]
4242
#[rustc_on_unimplemented = "`{Self}` cannot be sent between threads safely"]
@@ -338,7 +338,7 @@ pub trait Copy : Clone {
338338
/// [mutex]: ../../std/sync/struct.Mutex.html
339339
/// [rwlock]: ../../std/sync/struct.RwLock.html
340340
/// [unsafecell]: ../cell/struct.UnsafeCell.html
341-
/// [ub]: ../../reference.html#behavior-considered-undefined
341+
/// [ub]: ../../reference/behavior-considered-undefined.html
342342
/// [transmute]: ../../std/mem/fn.transmute.html
343343
#[stable(feature = "rust1", since = "1.0.0")]
344344
#[lang = "sync"]

src/libcore/mem.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ pub use intrinsics::transmute;
167167
/// [FFI]: ../../book/ffi.html
168168
/// [box]: ../../std/boxed/struct.Box.html
169169
/// [into_raw]: ../../std/boxed/struct.Box.html#method.into_raw
170-
/// [ub]: ../../reference.html#behavior-considered-undefined
170+
/// [ub]: ../../reference/behavior-considered-undefined.html
171171
#[inline]
172172
#[stable(feature = "rust1", since = "1.0.0")]
173173
pub fn forget<T>(t: T) {
@@ -318,7 +318,7 @@ pub fn align_of_val<T: ?Sized>(val: &T) -> usize {
318318
///
319319
/// [uninit]: fn.uninitialized.html
320320
/// [FFI]: ../../book/ffi.html
321-
/// [ub]: ../../reference.html#behavior-considered-undefined
321+
/// [ub]: ../../reference/behavior-considered-undefined.html
322322
///
323323
/// # Examples
324324
///
@@ -417,7 +417,7 @@ pub unsafe fn zeroed<T>() -> T {
417417
/// [`Vec`]: ../../std/vec/struct.Vec.html
418418
/// [`vec!`]: ../../std/macro.vec.html
419419
/// [`Clone`]: ../../std/clone/trait.Clone.html
420-
/// [ub]: ../../reference.html#behavior-considered-undefined
420+
/// [ub]: ../../reference/behavior-considered-undefined.html
421421
/// [write]: ../ptr/fn.write.html
422422
/// [copy]: ../intrinsics/fn.copy.html
423423
/// [copy_no]: ../intrinsics/fn.copy_nonoverlapping.html
@@ -626,7 +626,7 @@ pub fn drop<T>(_x: T) { }
626626
/// same size. This function triggers [undefined behavior][ub] if `U` is larger than
627627
/// `T`.
628628
///
629-
/// [ub]: ../../reference.html#behavior-considered-undefined
629+
/// [ub]: ../../reference/behavior-considered-undefined.html
630630
/// [size_of]: fn.size_of.html
631631
///
632632
/// # Examples

src/libstd/f32.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ impl f32 {
264264
///
265265
/// assert!(abs_difference <= f32::EPSILON);
266266
/// ```
267-
/// [floating-point]: ../reference.html#machine-types
267+
/// [floating-point]: ../reference/types.html#machine-types
268268
#[unstable(feature = "float_extras", reason = "signature is undecided",
269269
issue = "27752")]
270270
#[rustc_deprecated(since = "1.11.0",

src/libstd/f64.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ impl f64 {
206206
///
207207
/// assert!(abs_difference < 1e-10);
208208
/// ```
209-
/// [floating-point]: ../reference.html#machine-types
209+
/// [floating-point]: ../reference/types.html#machine-types
210210
#[unstable(feature = "float_extras", reason = "signature is undecided",
211211
issue = "27752")]
212212
#[rustc_deprecated(since = "1.11.0",

src/libstd/macros.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ pub mod builtin {
441441
/// leads to less duplicated code.
442442
///
443443
/// The syntax given to this macro is the same syntax as [the `cfg`
444-
/// attribute](../reference.html#conditional-compilation).
444+
/// attribute](../book/conditional-compilation.html).
445445
///
446446
/// # Examples
447447
///

0 commit comments

Comments
 (0)