From fcf8dedb99fa674a152b5625dd81938c4d8ff67b Mon Sep 17 00:00:00 2001 From: Simon Mazur Date: Mon, 5 Oct 2015 19:25:54 +0300 Subject: [PATCH] docs: anchors fixes --- src/doc/nomicon/lifetime-mismatch.md | 2 +- src/doc/nomicon/repr-rust.md | 2 +- src/doc/reference.md | 26 ++++++++++++------------- src/doc/trpl/concurrency.md | 2 +- src/doc/trpl/conditional-compilation.md | 2 +- src/doc/trpl/dining-philosophers.md | 2 +- src/doc/trpl/error-handling.md | 4 ++-- src/doc/trpl/glossary.md | 2 +- 8 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/doc/nomicon/lifetime-mismatch.md b/src/doc/nomicon/lifetime-mismatch.md index 8b01616ee0d..0ad8a78880e 100644 --- a/src/doc/nomicon/lifetime-mismatch.md +++ b/src/doc/nomicon/lifetime-mismatch.md @@ -78,4 +78,4 @@ TODO: other common problems? SEME regions stuff, mostly? -[ex2]: lifetimes.html#example-2:-aliasing-a-mutable-reference +[ex2]: lifetimes.html#example-aliasing-a-mutable-reference diff --git a/src/doc/nomicon/repr-rust.md b/src/doc/nomicon/repr-rust.md index e038ae5639b..85e17a9ce5b 100644 --- a/src/doc/nomicon/repr-rust.md +++ b/src/doc/nomicon/repr-rust.md @@ -151,4 +151,4 @@ use fairly elaborate algorithms to cache bits throughout nested types with special constrained representations. As such it is *especially* desirable that we leave enum layout unspecified today. -[dst]: exotic-sizes.html#dynamically-sized-types-(dsts) +[dst]: exotic-sizes.html#dynamically-sized-types-dsts diff --git a/src/doc/reference.md b/src/doc/reference.md index 2fce37eccae..aba7bed842e 100644 --- a/src/doc/reference.md +++ b/src/doc/reference.md @@ -1997,7 +1997,7 @@ On `struct`s: list of names `#[macro_use(foo, bar)]` restricts the import to just those macros named. The `extern crate` must appear at the crate root, not inside `mod`, which ensures proper function of the [`$crate` macro - variable](book/macros.html#the-variable-$crate). + variable](book/macros.html#the-variable-crate). - `macro_reexport` on an `extern crate` — re-export the named macros. @@ -2007,7 +2007,7 @@ On `struct`s: link it into the output. See the [macros section of the -book](book/macros.html#scoping-and-macro-import/export) for more information on +book](book/macros.html#scoping-and-macro-importexport) for more information on macro scope. @@ -2586,7 +2586,7 @@ Here are some examples: #### Moved and copied types When a [local variable](#variables) is used as an -[rvalue](#lvalues,-rvalues-and-temporaries), the variable will be copied +[rvalue](#lvalues-rvalues-and-temporaries), the variable will be copied if its type implements `Copy`. All others are moved. ### Literal expressions @@ -2605,7 +2605,7 @@ value, or the unit value. ### Path expressions A [path](#paths) used as an expression context denotes either a local variable -or an item. Path expressions are [lvalues](#lvalues,-rvalues-and-temporaries). +or an item. Path expressions are [lvalues](#lvalues-rvalues-and-temporaries). ### Tuple expressions @@ -2718,7 +2718,7 @@ foo().x; (Struct {a: 10, b: 20}).a; ``` -A field access is an [lvalue](#lvalues,-rvalues-and-temporaries) referring to +A field access is an [lvalue](#lvalues-rvalues-and-temporaries) referring to the value of that field. When the type providing the field inherits mutability, it can be [assigned](#assignment-expressions) to. @@ -2729,7 +2729,7 @@ fewer autoderefs to more. ### Array expressions -An [array](#array,-and-slice-types) _expression_ is written by enclosing zero +An [array](#array-and-slice-types) _expression_ is written by enclosing zero or more comma-separated expressions of uniform type in square brackets. In the `[expr ';' expr]` form, the expression after the `';'` must be a @@ -2745,9 +2745,9 @@ constant expression that can be evaluated at compile time, such as a ### Index expressions -[Array](#array,-and-slice-types)-typed expressions can be indexed by +[Array](#array-and-slice-types)-typed expressions can be indexed by writing a square-bracket-enclosed expression (the index) after them. When the -array is mutable, the resulting [lvalue](#lvalues,-rvalues-and-temporaries) can +array is mutable, the resulting [lvalue](#lvalues-rvalues-and-temporaries) can be assigned to. Indices are zero-based, and may be of any integral type. Vector access is @@ -2801,7 +2801,7 @@ before the expression they apply to. * `*` : Dereference. When applied to a [pointer](#pointer-types) it denotes the pointed-to location. For pointers to mutable locations, the resulting - [lvalue](#lvalues,-rvalues-and-temporaries) can be assigned to. + [lvalue](#lvalues-rvalues-and-temporaries) can be assigned to. On non-pointer types, it calls the `deref` method of the `std::ops::Deref` trait, or the `deref_mut` method of the `std::ops::DerefMut` trait (if implemented by the type and required for an outer expression that will or @@ -2942,8 +2942,8 @@ surprising side-effects on the dynamic execution semantics. #### Assignment expressions An _assignment expression_ consists of an -[lvalue](#lvalues,-rvalues-and-temporaries) expression followed by an equals -sign (`=`) and an [rvalue](#lvalues,-rvalues-and-temporaries) expression. +[lvalue](#lvalues-rvalues-and-temporaries) expression followed by an equals +sign (`=`) and an [rvalue](#lvalues-rvalues-and-temporaries) expression. Evaluating an assignment expression [either copies or moves](#moved-and-copied-types) its right-hand operand to its left-hand @@ -3170,7 +3170,7 @@ stands for a *single* data field, whereas a wildcard `..` stands for *all* the fields of a particular variant. A `match` behaves differently depending on whether or not the head expression -is an [lvalue or an rvalue](#lvalues,-rvalues-and-temporaries). If the head +is an [lvalue or an rvalue](#lvalues-rvalues-and-temporaries). If the head expression is an rvalue, it is first evaluated into a temporary location, and the resulting value is sequentially compared to the patterns in the arms until a match is found. The first arm with a matching pattern is chosen as the branch @@ -3489,7 +3489,7 @@ enclosing `enum` or `struct` type itself. Such recursion has restrictions: * Recursive types must include a nominal type in the recursion (not mere [type definitions](grammar.html#type-definitions), - or other structural types such as [arrays](#array,-and-slice-types) or [tuples](#tuple-types)). + or other structural types such as [arrays](#array-and-slice-types) or [tuples](#tuple-types)). * A recursive `enum` item must have at least one non-recursive constructor (in order to give the recursion a basis case). * The size of a recursive type must be finite; diff --git a/src/doc/trpl/concurrency.md b/src/doc/trpl/concurrency.md index 7028bade6de..a17f3a5cae5 100644 --- a/src/doc/trpl/concurrency.md +++ b/src/doc/trpl/concurrency.md @@ -53,7 +53,7 @@ For sharing references across threads, Rust provides a wrapper type called `Arc`. `Arc` implements `Send` and `Sync` if and only if `T` implements both `Send` and `Sync`. For example, an object of type `Arc>` cannot be transferred across threads because -[`RefCell`](choosing-your-guarantees.html#refcell%3Ct%3E) does not implement +[`RefCell`](choosing-your-guarantees.html#refcellt) does not implement `Sync`, consequently `Arc>` would not implement `Send`. These two traits allow you to use the type system to make strong guarantees diff --git a/src/doc/trpl/conditional-compilation.md b/src/doc/trpl/conditional-compilation.md index a944b852d24..a6ff75db89b 100644 --- a/src/doc/trpl/conditional-compilation.md +++ b/src/doc/trpl/conditional-compilation.md @@ -34,7 +34,7 @@ These can nest arbitrarily: As for how to enable or disable these switches, if you’re using Cargo, they get set in the [`[features]` section][features] of your `Cargo.toml`: -[features]: http://doc.crates.io/manifest.html#the-%5Bfeatures%5D-section +[features]: http://doc.crates.io/manifest.html#the-features-section ```toml [features] diff --git a/src/doc/trpl/dining-philosophers.md b/src/doc/trpl/dining-philosophers.md index 9539cd3447c..8d2432f285e 100644 --- a/src/doc/trpl/dining-philosophers.md +++ b/src/doc/trpl/dining-philosophers.md @@ -434,7 +434,7 @@ ownership of the values it’s capturing. Primarily, the `p` variable of the Inside the thread, all we do is call `eat()` on `p`. Also note that the call to `thread::spawn` lacks a trailing semicolon, making this an expression. This distinction is important, yielding the correct return value. For more details, read [Expressions vs. Statements][es]. -[es]: functions.html#expressions-vs.-statements +[es]: functions.html#expressions-vs-statements ```rust,ignore }).collect(); diff --git a/src/doc/trpl/error-handling.md b/src/doc/trpl/error-handling.md index c1fb112206e..e538a40415d 100644 --- a/src/doc/trpl/error-handling.md +++ b/src/doc/trpl/error-handling.md @@ -28,7 +28,7 @@ systems may want to jump around. * [The `Result` type](#the-result-type) * [Parsing integers](#parsing-integers) * [The `Result` type alias idiom](#the-result-type-alias-idiom) - * [A brief interlude: unwrapping isn't evil](#a-brief-interlude-unwrapping-isn't-evil) + * [A brief interlude: unwrapping isn't evil](#a-brief-interlude-unwrapping-isnt-evil) * [Working with multiple error types](#working-with-multiple-error-types) * [Composing `Option` and `Result`](#composing-option-and-result) * [The limits of combinators](#the-limits-of-combinators) @@ -1470,7 +1470,7 @@ representation. But certainly, this will vary depending on use cases. At a minimum, you should probably implement the [`Error`](../std/error/trait.Error.html) trait. This will give users of your library some minimum flexibility for -[composing errors](#the-real-try!-macro). Implementing the `Error` trait also +[composing errors](#the-real-try-macro). Implementing the `Error` trait also means that users are guaranteed the ability to obtain a string representation of an error (because it requires impls for both `fmt::Debug` and `fmt::Display`). diff --git a/src/doc/trpl/glossary.md b/src/doc/trpl/glossary.md index 6a5a45fdb2c..106d225d2d0 100644 --- a/src/doc/trpl/glossary.md +++ b/src/doc/trpl/glossary.md @@ -42,7 +42,7 @@ In the example above `x` and `y` have arity 2. `z` has arity 3. A type without a statically known size or alignment. ([more info][link]) -[link]: ../nomicon/exotic-sizes.html#dynamically-sized-types-(dsts) +[link]: ../nomicon/exotic-sizes.html#dynamically-sized-types-dsts ### Expression