From 5f325e918df85472a5919c373e9aed0605fb51c8 Mon Sep 17 00:00:00 2001 From: Steve Klabnik Date: Mon, 20 Feb 2017 17:25:33 -0500 Subject: [PATCH] fix some links --- src/doc/book/src/README.md | 2 -- src/doc/book/src/casting-between-types.md | 9 +++------ src/doc/book/src/conditional-compilation.md | 5 +---- src/doc/book/src/macros.md | 9 --------- src/doc/book/src/unsafe.md | 2 +- .../book/src/using-rust-without-the-standard-library.md | 2 +- src/doc/unstable-book/src/alloc-jemalloc.md | 2 +- src/doc/unstable-book/src/alloc-system.md | 2 +- src/doc/unstable-book/src/plugin.md | 4 ++-- 9 files changed, 10 insertions(+), 27 deletions(-) diff --git a/src/doc/book/src/README.md b/src/doc/book/src/README.md index 9162642b1cc..ade4d52c1eb 100644 --- a/src/doc/book/src/README.md +++ b/src/doc/book/src/README.md @@ -21,7 +21,6 @@ is the first. After this: * [Tutorial: Guessing Game][gg] - Learn some Rust with a small project. * [Syntax and Semantics][ss] - Each bit of Rust, broken down into small chunks. * [Effective Rust][er] - Higher-level concepts for writing excellent Rust code. -* [Nightly Rust][nr] - Cutting-edge features that aren’t in stable builds yet. * [Glossary][gl] - A reference of terms used in the book. * [Bibliography][bi] - Background on Rust's influences, papers about Rust. @@ -29,7 +28,6 @@ is the first. After this: [gg]: guessing-game.html [er]: effective-rust.html [ss]: syntax-and-semantics.html -[nr]: nightly-rust.html [gl]: glossary.html [bi]: bibliography.html diff --git a/src/doc/book/src/casting-between-types.md b/src/doc/book/src/casting-between-types.md index 853fb1ec254..26cd718475e 100644 --- a/src/doc/book/src/casting-between-types.md +++ b/src/doc/book/src/casting-between-types.md @@ -151,12 +151,9 @@ elements of the array. These kinds of casts are very dangerous, because they make assumptions about the way that multiple underlying structures are implemented. For this, we need something more dangerous. -The `transmute` function is provided by a [compiler intrinsic][intrinsics], and -what it does is very simple, but very scary. It tells Rust to treat a value of -one type as though it were another type. It does this regardless of the -typechecking system, and completely trusts you. - -[intrinsics]: intrinsics.html +The `transmute` function is very simple, but very scary. It tells Rust to treat +a value of one type as though it were another type. It does this regardless of +the typechecking system, and completely trusts you. In our previous example, we know that an array of four `u8`s represents a `u32` properly, and so we want to do the cast. Using `transmute` instead of `as`, diff --git a/src/doc/book/src/conditional-compilation.md b/src/doc/book/src/conditional-compilation.md index 938c1c51326..0562e9fc430 100644 --- a/src/doc/book/src/conditional-compilation.md +++ b/src/doc/book/src/conditional-compilation.md @@ -79,8 +79,7 @@ Will be the same as `#[b]` if `a` is set by `cfg` attribute, and nothing otherwi # cfg! -The `cfg!` [syntax extension][compilerplugins] lets you use these kinds of flags -elsewhere in your code, too: +The `cfg!` macro lets you use these kinds of flags elsewhere in your code, too: ```rust if cfg!(target_os = "macos") || cfg!(target_os = "ios") { @@ -88,7 +87,5 @@ if cfg!(target_os = "macos") || cfg!(target_os = "ios") { } ``` -[compilerplugins]: compiler-plugins.html - These will be replaced by a `true` or `false` at compile-time, depending on the configuration settings. diff --git a/src/doc/book/src/macros.md b/src/doc/book/src/macros.md index 93f63ddc0a5..fa8e8975a5b 100644 --- a/src/doc/book/src/macros.md +++ b/src/doc/book/src/macros.md @@ -761,12 +761,3 @@ to typecheck, and don’t want to worry about writing out the body of the function. One example of this situation is implementing a trait with multiple required methods, where you want to tackle one at a time. Define the others as `unimplemented!` until you’re ready to write them. - -# Procedural macros - -If Rust’s macro system can’t do what you need, you may want to write a -[compiler plugin](compiler-plugins.html) instead. Compared to `macro_rules!` -macros, this is significantly more work, the interfaces are much less stable, -and bugs can be much harder to track down. In exchange you get the -flexibility of running arbitrary Rust code within the compiler. Syntax -extension plugins are sometimes called ‘procedural macros’ for this reason. diff --git a/src/doc/book/src/unsafe.md b/src/doc/book/src/unsafe.md index e90a4b1c268..9bf59fe2abd 100644 --- a/src/doc/book/src/unsafe.md +++ b/src/doc/book/src/unsafe.md @@ -139,4 +139,4 @@ I’ll repeat again: even though you _can_ do arbitrary things in unsafe blocks and functions doesn’t mean you should. The compiler will act as though you’re upholding its invariants, so be careful! -[intrinsics]: intrinsics.html +[intrinsics]: ../unstable-book/intrinsics.html diff --git a/src/doc/book/src/using-rust-without-the-standard-library.md b/src/doc/book/src/using-rust-without-the-standard-library.md index 8458f9314f9..709d10f4e47 100644 --- a/src/doc/book/src/using-rust-without-the-standard-library.md +++ b/src/doc/book/src/using-rust-without-the-standard-library.md @@ -9,7 +9,7 @@ don’t want to use the standard library via an attribute: `#![no_std]`. > Note: This feature is technically stable, but there are some caveats. For > one, you can build a `#![no_std]` _library_ on stable, but not a _binary_. > For details on binaries without the standard library, see [the nightly -> chapter on `#![no_std]`](no-stdlib.html) +> chapter on 'lang items'](../unstable-book/lang-items.html#using-libc) To use `#![no_std]`, add it to your crate root: diff --git a/src/doc/unstable-book/src/alloc-jemalloc.md b/src/doc/unstable-book/src/alloc-jemalloc.md index 47c44ddc374..9bffa2ff99b 100644 --- a/src/doc/unstable-book/src/alloc-jemalloc.md +++ b/src/doc/unstable-book/src/alloc-jemalloc.md @@ -4,7 +4,7 @@ The tracking issue for this feature is: [#33082] [#33082]: https://github.com/rust-lang/rust/issues/33082 -See also [`alloc_system`](alloc-system.md). +See also [`alloc_system`](alloc-system.html). ------------------------ diff --git a/src/doc/unstable-book/src/alloc-system.md b/src/doc/unstable-book/src/alloc-system.md index f7d648c3759..6fa89179d8e 100644 --- a/src/doc/unstable-book/src/alloc-system.md +++ b/src/doc/unstable-book/src/alloc-system.md @@ -4,7 +4,7 @@ The tracking issue for this feature is: [#33082] [#33082]: https://github.com/rust-lang/rust/issues/33082 -See also [`alloc_jemalloc`](alloc-jemalloc.md). +See also [`alloc_jemalloc`](alloc-jemalloc.html). ------------------------ diff --git a/src/doc/unstable-book/src/plugin.md b/src/doc/unstable-book/src/plugin.md index 1ec28bbcf03..313ef2ec91d 100644 --- a/src/doc/unstable-book/src/plugin.md +++ b/src/doc/unstable-book/src/plugin.md @@ -39,7 +39,7 @@ of a library. Plugins can extend Rust's syntax in various ways. One kind of syntax extension is the procedural macro. These are invoked the same way as [ordinary -macros](macros.html), but the expansion is performed by arbitrary Rust +macros](../book/macros.html), but the expansion is performed by arbitrary Rust code that manipulates syntax trees at compile time. @@ -137,7 +137,7 @@ enum. For a more involved macro example, see ## Tips and tricks -Some of the [macro debugging tips](macros.html#Debugging%20macro%20code) are applicable. +Some of the [macro debugging tips](../book/macros.html#debugging-macro-code) are applicable. You can use `syntax::parse` to turn token trees into higher-level syntax elements like expressions: