Skip to content

Commit

Permalink
Fix links in the referece
Browse files Browse the repository at this point in the history
and remove references to the unit type, which no longer exists

Fixes #24999
  • Loading branch information
steveklabnik committed May 10, 2015
1 parent 750f2c6 commit e278de4
Showing 1 changed file with 17 additions and 20 deletions.
37 changes: 17 additions & 20 deletions src/doc/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,27 @@ You may also be interested in the [grammar].

## Unicode productions

A few productions in Rust's grammar permit Unicode code points outside the ASCII
range. We define these productions in terms of character properties specified
in the Unicode standard, rather than in terms of ASCII-range code points. The
section [Special Unicode Productions](#special-unicode-productions) lists these
productions.
A few productions in Rust's grammar permit Unicode code points outside the
ASCII range. We define these productions in terms of character properties
specified in the Unicode standard, rather than in terms of ASCII-range code
points. The grammar has a [Special Unicode Productions][unicodeproductions]
section that lists these productions.

[unicodeproductions]: grammar.html#special-unicode-productions

## String table productions

Some rules in the grammar — notably [unary
operators](#unary-operator-expressions), [binary
operators](#binary-operator-expressions), and [keywords](#keywords) — are
operators](#binary-operator-expressions), and [keywords][keywords] — are
given in a simplified form: as a listing of a table of unquoted, printable
whitespace-separated strings. These cases form a subset of the rules regarding
the [token](#tokens) rule, and are assumed to be the result of a
lexical-analysis phase feeding the parser, driven by a DFA, operating over the
disjunction of all such string table entries.

[keywords]: grammar.html#keywords

When such a string enclosed in double-quotes (`"`) occurs inside the grammar,
it is an implicit reference to a single member of such a string table
production. See [tokens](#tokens) for more information.
Expand Down Expand Up @@ -75,7 +79,7 @@ An identifier is any nonempty Unicode[^non_ascii_idents] string of the following
- The first character has property `XID_start`
- The remaining characters have property `XID_continue`

that does _not_ occur in the set of [keywords](#keywords).
that does _not_ occur in the set of [keywords][keywords].

> **Note**: `XID_start` and `XID_continue` as character properties cover the
> character ranges used to form the more familiar C and Java language-family
Expand Down Expand Up @@ -401,7 +405,7 @@ Symbols are a general class of printable [token](#tokens) that play structural
roles in a variety of grammar productions. They are catalogued here for
completeness as the set of remaining miscellaneous printable tokens that do not
otherwise appear as [unary operators](#unary-operator-expressions), [binary
operators](#binary-operator-expressions), or [keywords](#keywords).
operators](#binary-operator-expressions), or [keywords][keywords].


## Paths
Expand Down Expand Up @@ -611,7 +615,7 @@ module needs its own source file: [module definitions](#modules) can be nested
within one file.

Each source file contains a sequence of zero or more `item` definitions, and
may optionally begin with any number of [attributes](#Items and attributes)
may optionally begin with any number of [attributes](#items-and-attributes)
that apply to the containing module, most of which influence the behavior of
the compiler. The anonymous crate module can have additional attributes that
apply to the crate as a whole.
Expand Down Expand Up @@ -653,7 +657,7 @@ There are several kinds of item:
* [`use` declarations](#use-declarations)
* [modules](#modules)
* [functions](#functions)
* [type definitions](#type-definitions)
* [type definitions](grammar.html#type-definitions)
* [structures](#structures)
* [enumerations](#enumerations)
* [static items](#static-items)
Expand Down Expand Up @@ -772,7 +776,7 @@ extern crate std as ruststd; // linking to 'std' under another name
A _use declaration_ creates one or more local name bindings synonymous with
some other [path](#paths). Usually a `use` declaration is used to shorten the
path required to refer to a module item. These declarations may appear at the
top of [modules](#modules) and [blocks](#blocks).
top of [modules](#modules) and [blocks](grammar.html#block-expressions).

> **Note**: Unlike in many languages,
> `use` declarations in Rust do *not* declare linkage dependency with external crates.
Expand Down Expand Up @@ -1143,9 +1147,7 @@ let px: i32 = match p { Point(x, _) => x };
```

A _unit-like struct_ is a structure without any fields, defined by leaving off
the list of fields entirely. Such types will have a single value, just like
the [unit value `()`](#unit-and-boolean-literals) of the unit type. For
example:
the list of fields entirely. Such types will have a single value. For example:

```
struct Cookie;
Expand Down Expand Up @@ -2435,11 +2437,6 @@ comma:
(0); // zero in parentheses
```

### Unit expressions

The expression `()` denotes the _unit value_, the only value of the type with
the same name.

### Structure expressions

There are several forms of structure expressions. A _structure expression_
Expand Down Expand Up @@ -3259,7 +3256,7 @@ constructor or `struct` field may refer, directly or indirectly, to the
enclosing `enum` or `struct` type itself. Such recursion has restrictions:

* Recursive types must include a nominal type in the recursion
(not mere [type definitions](#type-definitions),
(not mere [type definitions](grammar.html#type-definitions),
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).
Expand Down

0 comments on commit e278de4

Please sign in to comment.