Skip to content

Commit f1be02e

Browse files
author
Ulrik Sverdrup
committed
docs: Fixes in Reference Chapter 6.1
1 parent 44dbfc1 commit f1be02e

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

src/doc/reference.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -653,9 +653,10 @@ There are several kinds of item:
653653
* [`use` declarations](#use-declarations)
654654
* [modules](#modules)
655655
* [functions](#functions)
656-
* [type definitions](#type-definitions)
656+
* [type aliases](#type-aliases)
657657
* [structures](#structures)
658658
* [enumerations](#enumerations)
659+
* [constant items](#constant-items)
659660
* [static items](#static-items)
660661
* [traits](#traits)
661662
* [implementations](#implementations)
@@ -672,16 +673,16 @@ which sub-item declarations may appear.
672673

673674
### Type Parameters
674675

675-
All items except modules may be *parameterized* by type. Type parameters are
676-
given as a comma-separated list of identifiers enclosed in angle brackets
677-
(`<...>`), after the name of the item and before its definition. The type
678-
parameters of an item are considered "part of the name", not part of the type
679-
of the item. A referencing [path](#paths) must (in principle) provide type
680-
arguments as a list of comma-separated types enclosed within angle brackets, in
681-
order to refer to the type-parameterized item. In practice, the type-inference
682-
system can usually infer such argument types from context. There are no
683-
general type-parametric types, only type-parametric items. That is, Rust has
684-
no notion of type abstraction: there are no first-class "forall" types.
676+
All items except modules, constants and statics may be *parameterized* by type.
677+
Type parameters are given as a comma-separated list of identifiers enclosed in
678+
angle brackets (`<...>`), after the name of the item and before its definition.
679+
The type parameters of an item are considered "part of the name", not part of
680+
the type of the item. A referencing [path](#paths) must (in principle) provide
681+
type arguments as a list of comma-separated types enclosed within angle
682+
brackets, in order to refer to the type-parameterized item. In practice, the
683+
type-inference system can usually infer such argument types from context. There
684+
are no general type-parametric types, only type-parametric items. That is, Rust
685+
has no notion of type abstraction: there are no first-class "forall" types.
685686

686687
### Modules
687688

@@ -743,7 +744,7 @@ mod thread {
743744
}
744745
```
745746

746-
##### Extern crate declarations
747+
#### Extern crate declarations
747748

748749
An _`extern crate` declaration_ specifies a dependency on an external crate.
749750
The external crate is then bound into the declaring scope as the `ident`
@@ -768,12 +769,12 @@ extern crate std; // equivalent to: extern crate std as std;
768769
extern crate std as ruststd; // linking to 'std' under another name
769770
```
770771

771-
##### Use declarations
772+
#### Use declarations
772773

773774
A _use declaration_ creates one or more local name bindings synonymous with
774775
some other [path](#paths). Usually a `use` declaration is used to shorten the
775776
path required to refer to a module item. These declarations may appear at the
776-
top of [modules](#modules) and [blocks](#blocks).
777+
top of [modules](#modules) and [blocks](#block-expressions).
777778

778779
> **Note**: Unlike in many languages,
779780
> `use` declarations in Rust do *not* declare linkage dependency with external crates.

0 commit comments

Comments
 (0)