fix some links
This commit is contained in:
parent
6fb2545f77
commit
5f325e918d
@ -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
|
||||
|
||||
|
@ -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`,
|
||||
|
@ -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.
|
||||
|
@ -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.
|
||||
|
@ -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
|
||||
|
@ -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:
|
||||
|
||||
|
@ -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).
|
||||
|
||||
------------------------
|
||||
|
||||
|
@ -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).
|
||||
|
||||
------------------------
|
||||
|
||||
|
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user