Skip to content

Commit d54cc1c

Browse files
committed
Fix internal linking in the tutorial
1 parent df02ca1 commit d54cc1c

File tree

1 file changed

+16
-33
lines changed

1 file changed

+16
-33
lines changed

doc/tutorial.md

Lines changed: 16 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ This is a tutorial for the Rust programming language. It assumes the
88
reader is familiar with the basic concepts of programming, and has
99
programmed in one or more other languages before. The tutorial covers
1010
the whole language, though not with the depth and precision of the
11-
[language reference][1].
12-
13-
[1]: http://www.rust-lang.org/doc/rust.html
11+
[language reference](rust.html).
1412

1513
## Disclaimer
1614

@@ -106,7 +104,7 @@ live inside a function.
106104
Rust programs can also be compiled as libraries, and included in other
107105
programs. The `use std` directive that appears at the top of a lot of
108106
examples imports the [standard library][std]. This is described in more
109-
detail [later on](mod.html).
107+
detail [later on](#modules-and-crates).
110108

111109
[std]: http://doc.rust-lang.org/doc/std/index/General.html
112110

@@ -332,10 +330,9 @@ type monster_size = uint;
332330
This will provide a synonym, `monster_size`, for unsigned integers. It
333331
will not actually create a new type—`monster_size` and `uint` can be
334332
used interchangeably, and using one where the other is expected is not
335-
a type error. Read about [single-variant enums][sve] further on if you
336-
need to create a type name that's not just a synonym.
337-
338-
[sve]: data.html#single_variant_enum
333+
a type error. Read about [single-variant enums](#single_variant_enum)
334+
further on if you need to create a type name that's not just a
335+
synonym.
339336

340337
## Literals
341338

@@ -435,8 +432,6 @@ assert y == 4u;
435432

436433
## Attributes
437434

438-
<a name="conditional"></a>
439-
440435
Every definition can be annotated with attributes. Attributes are meta
441436
information that can serve a variety of purposes. One of those is
442437
conditional compilation:
@@ -457,12 +452,12 @@ Attributes are always wrapped in hash-braces (`#[attr]`). Inside the
457452
braces, a small minilanguage is supported, whose interpretation
458453
depends on the attribute that's being used. The simplest form is a
459454
plain name (as in `#[test]`, which is used by the [built-in test
460-
framework](test.html '')). A name-value pair can be provided using an `=`
455+
framework](#testing)). A name-value pair can be provided using an `=`
461456
character followed by a literal (as in `#[license = "BSD"]`, which is
462457
a valid way to annotate a Rust program as being released under a
463458
BSD-style license). Finally, you can have a name followed by a
464459
comma-separated list of nested attributes, as in the `cfg` example
465-
above, or in this [crate](mod.html) metadata declaration:
460+
above, or in this [crate](#modules-and-crates) metadata declaration:
466461

467462
~~~~
468463
## ignore
@@ -662,7 +657,7 @@ moment.
662657

663658
## Failure
664659

665-
The `fail` keyword causes the current [task][tasks] to fail. You use
660+
The `fail` keyword causes the current [task](#tasks) to fail. You use
666661
it to indicate unexpected failure, much like you'd use `exit(1)` in a
667662
C program, except that in Rust, it is possible for other tasks to
668663
handle the failure, allowing the program to continue running.
@@ -671,8 +666,6 @@ handle the failure, allowing the program to continue running.
671666
to access a vector out of bounds, or running a pattern match with no
672667
matching clauses, both result in the equivalent of a `fail`.
673668

674-
[tasks]: task.html
675-
676669
## Logging
677670

678671
Rust has a built-in logging mechanism, using the `log` statement.
@@ -835,14 +828,12 @@ call_twice(bare_function);
835828

836829
### Unique closures
837830

838-
<a name="unique"></a>
839-
840831
Unique closures, written `fn~` in analogy to the `~` pointer type (see
841832
next section), hold on to things that can safely be sent between
842833
processes. They copy the values they close over, much like boxed
843834
closures, but they also 'own' them—meaning no other code can access
844835
them. Unique closures mostly exist to for spawning new
845-
[tasks](task.html).
836+
[tasks](#tasks).
846837

847838
### Shorthand syntax
848839

@@ -1151,8 +1142,6 @@ All pointer types can be dereferenced with the `*` unary operator.
11511142

11521143
### Shared boxes
11531144

1154-
<a name="shared-box"></a>
1155-
11561145
Shared boxes are pointers to heap-allocated, reference counted memory.
11571146
A cycle collector ensures that circular references do not result in
11581147
memory leaks.
@@ -1174,8 +1163,6 @@ Shared boxes never cross task boundaries.
11741163

11751164
### Unique boxes
11761165

1177-
<a name="unique-box"></a>
1178-
11791166
In contrast to shared boxes, unique boxes are not reference counted.
11801167
Instead, it is statically guaranteed that only a single owner of the
11811168
box exists at any time.
@@ -1414,7 +1401,7 @@ records and tags *are* passed by pointer, but single-word values, like
14141401
integers and pointers, are simply passed by value. Most of the time,
14151402
the programmer does not have to worry about this, as the compiler will
14161403
simply pick the most efficient passing style. There is one exception,
1417-
which will be described in the section on [generics](generic.html).
1404+
which will be described in the section on [generics](#generics).
14181405

14191406
To explicitly set the passing-style for a parameter, you prefix the
14201407
argument name with a sigil. There are two special passing styles that
@@ -1542,8 +1529,6 @@ without any sophistication).
15421529

15431530
## Kinds
15441531

1545-
<a name="kind"></a>
1546-
15471532
Perhaps surprisingly, the 'copy' (duplicate) operation is not defined
15481533
for all Rust types. Resource types (types with destructors) can not be
15491534
copied, and neither can any type whose copying would require copying a
@@ -1724,7 +1709,7 @@ A set of basic library routines, mostly related to built-in datatypes
17241709
and the task system, are always implicitly linked and included in any
17251710
Rust program, unless the `--no-core` compiler switch is given.
17261711

1727-
This library is document [here][core].
1712+
This library is documented [here][core].
17281713

17291714
[core]: http://doc.rust-lang.org/doc/core/index/General.html
17301715

@@ -2310,11 +2295,9 @@ supposed to point at, this is safe.
23102295
Rust supports a system of lightweight tasks, similar to what is found
23112296
in Erlang or other actor systems. Rust tasks communicate via messages
23122297
and do not share data. However, it is possible to send data without
2313-
copying it by making use of [unique boxes][uniques], which allow the
2314-
sending task to release ownership of a value, so that the receiving
2315-
task can keep on using it.
2316-
2317-
[uniques]: data.html#unique-box
2298+
copying it by making use of [unique boxes](#unique-boxes), which allow
2299+
the sending task to release ownership of a value, so that the
2300+
receiving task can keep on using it.
23182301

23192302
NOTE: As Rust evolves, we expect the Task API to grow and change
23202303
somewhat. The tutorial documents the API as it exists today.
@@ -2333,7 +2316,7 @@ let child_task = task::spawn {||
23332316
~~~~
23342317

23352318
The argument to `task::spawn()` is a [unique
2336-
closure](func.html#unique) of type `fn~()`, meaning that it takes no
2319+
closure](#unique-closures) of type `fn~()`, meaning that it takes no
23372320
arguments and generates no return value. The effect of `task::spawn()`
23382321
is to fire up a child task that will execute the closure in parallel
23392322
with the creator. The result is a task id, here stored into the
@@ -2553,4 +2536,4 @@ ignored.
25532536
A program compiled as a test runner will have the configuration flag
25542537
`test` defined, so that you can add code that won't be included in a
25552538
normal compile with the `#[cfg(test)]` attribute (see [conditional
2556-
compilation](syntax.md#conditional)).
2539+
compilation](#attributes)).

0 commit comments

Comments
 (0)