Skip to content

Commit 152f877

Browse files
authored
Merge pull request #953 from Havvy/define-rust
Define rust
2 parents 03483b9 + b16ae38 commit 152f877

File tree

1 file changed

+63
-76
lines changed

1 file changed

+63
-76
lines changed

src/introduction.md

+63-76
Original file line numberDiff line numberDiff line change
@@ -1,102 +1,96 @@
11
# Introduction
22

3-
This book is the primary reference for the Rust programming language. It
4-
provides three kinds of material:
3+
This book is the primary reference for the Rust programming language.
4+
It provides three kinds of material:
55

66
- Chapters that informally describe each language construct and their use.
7-
- Chapters that informally describe the memory model, concurrency model,
8-
runtime services, linkage model, and debugging facilities.
9-
- Appendix chapters providing rationale and references to languages that
10-
influenced the design.
7+
- Chapters that informally describe the memory model, concurrency model, runtime services, linkage model, and debugging facilities.
8+
- Appendix chapters providing rationale and references to languages that influenced the design.
119

1210
<div class="warning">
1311

14-
Warning: This book is incomplete. Documenting everything takes a while. See
15-
the [GitHub issues] for what is not documented in this book.
12+
Warning:
13+
This book is incomplete. Documenting everything takes a while.
14+
See the [GitHub issues] for what is not documented in this book.
1615

1716
</div>
1817

19-
## What *The Reference* is Not
18+
## Rust releases
2019

21-
This book does not serve as an introduction to the language. Background
22-
familiarity with the language is assumed. A separate [book] is available to
23-
help acquire such background familiarity.
20+
Rust has a new language release every six weeks.
21+
The first stable release of the language was Rust 1.0.0, followed by Rust 1.1.0 and so on.
22+
Tools (`rustc`, `cargo`, etc.) and documentation ([Standard library], this book, etc.) are released with the language release.
2423

25-
This book also does not serve as a reference to the [standard library]
26-
included in the language distribution. Those libraries are documented
27-
separately by extracting documentation attributes from their source code. Many
28-
of the features that one might expect to be language features are library
29-
features in Rust, so what you're looking for may be there, not here.
24+
The latest release of this book, matching the latest Rust version, can always be found at <https://doc.rust-lang.org/reference/>.
25+
Prior versions can be found by adding the Rust version before the "reference" directory.
26+
For example, the Reference for Rust 1.49.0 is located at <https://doc.rust-lang.org/1.49.0/reference/>.
3027

31-
Similarly, this book does not usually document the specifics of `rustc` as a
32-
tool or of Cargo. `rustc` has its own [book][rustc book]. Cargo has a
33-
[book][cargo book] that contains a [reference][cargo reference]. There are a few
34-
pages such as [linkage] that still describe how `rustc` works.
28+
## What *The Reference* is not
3529

36-
This book also only serves as a reference to what is available in stable
37-
Rust. For unstable features being worked on, see the [Unstable Book].
30+
This book does not serve as an introduction to the language.
31+
Background familiarity with the language is assumed.
32+
A separate [book] is available to help acquire such background familiarity.
3833

39-
Rust compilers, including `rustc`, will perform optimizations. The reference
40-
does not specify what optimizations are allowed or disallowed. Instead, think of
41-
the compiled program as a black box. You can only probe by running it, feeding
42-
it input and observing its output. Everything that happens that way must conform
43-
to what the reference says.
34+
This book also does not serve as a reference to the [standard library] included in the language distribution.
35+
Those libraries are documented separately by extracting documentation attributes from their source code.
36+
Many of the features that one might expect to be language features are library features in Rust, so what you're looking for may be there, not here.
4437

45-
Finally, this book is not normative. It may include details that are
46-
specific to `rustc` itself, and should not be taken as a specification for
47-
the Rust language. We intend to produce such a book someday, and until then,
48-
the reference is the closest thing we have to one.
38+
Similarly, this book does not usually document the specifics of `rustc` as a tool or of Cargo.
39+
`rustc` has its own [book][rustc book].
40+
Cargo has a [book][cargo book] that contains a [reference][cargo reference].
41+
There are a few pages such as [linkage] that still describe how `rustc` works.
4942

50-
## How to Use This Book
43+
This book also only serves as a reference to what is available in stable Rust.
44+
For unstable features being worked on, see the [Unstable Book].
5145

52-
This book does not assume you are reading this book sequentially. Each
53-
chapter generally can be read standalone, but will cross-link to other chapters
54-
for facets of the language they refer to, but do not discuss.
46+
Rust compilers, including `rustc`, will perform optimizations.
47+
The reference does not specify what optimizations are allowed or disallowed.
48+
Instead, think of the compiled program as a black box.
49+
You can only probe by running it, feeding it input and observing its output.
50+
Everything that happens that way must conform to what the reference says.
51+
52+
Finally, this book is not normative.
53+
It may include details that are specific to `rustc` itself, and should not be taken as a specification for the Rust language.
54+
We intend to produce such a book someday, and until then, the reference is the closest thing we have to one.
55+
56+
## How to use this book
57+
58+
This book does not assume you are reading this book sequentially.
59+
Each chapter generally can be read standalone, but will cross-link to other chapters for facets of the language they refer to, but do not discuss.
5560

5661
There are two main ways to read this document.
5762

58-
The first is to answer a specific question. If you know which chapter answers
59-
that question, you can jump to that chapter in the table of contents. Otherwise,
60-
you can press `s` or the click the magnifying glass on the top bar to search for
61-
keywords related to your question. For example, say you wanted to know when a
62-
temporary value created in a let statement is dropped. If you didn't already
63-
know that the [lifetime of temporaries] is defined in the [expressions chapter],
64-
you could search "temporary let" and the first search result will take you to
65-
that section.
63+
The first is to answer a specific question.
64+
If you know which chapter answers that question, you can jump to that chapter in the table of contents.
65+
Otherwise, you can press `s` or the click the magnifying glass on the top bar to search for keywords related to your question.
66+
For example, say you wanted to know when a temporary value created in a let statement is dropped.
67+
If you didn't already know that the [lifetime of temporaries] is defined in the [expressions chapter], you could search "temporary let" and the first search result will take you to that section.
6668

6769
The second is to generally improve your knowledge of a facet of the language.
68-
In that case, just browse the table of contents until you see something you
69-
want to know more about, and just start reading. If a link looks interesting,
70-
click it, and read about that section.
70+
In that case, just browse the table of contents until you see something you want to know more about, and just start reading.
71+
If a link looks interesting, click it, and read about that section.
7172

72-
That said, there is no wrong way to read this book. Read it however you feel
73-
helps you best.
73+
That said, there is no wrong way to read this book. Read it however you feel helps you best.
7474

7575
### Conventions
7676

77-
Like all technical books, this book has certain conventions in how it displays
78-
information. These conventions are documented here.
77+
Like all technical books, this book has certain conventions in how it displays information.
78+
These conventions are documented here.
7979

80-
* Statements that define a term contain that term in *italics*. Whenever that
81-
term is used outside of that chapter, it is usually a link to the section that
82-
has this definition.
80+
* Statements that define a term contain that term in *italics*.
81+
Whenever that term is used outside of that chapter, it is usually a link to the section that has this definition.
8382

8483
An *example term* is an example of a term being defined.
8584

86-
* Differences in the language by which edition the crate is compiled under are
87-
in a blockquote that start with the words "Edition Differences:" in **bold**.
85+
* Differences in the language by which edition the crate is compiled under are in a blockquote that start with the words "Edition Differences:" in **bold**.
8886

89-
> **Edition Differences**: In the 2015 edition, this syntax is valid that is
90-
> disallowed as of the 2018 edition.
87+
> **Edition Differences**: In the 2015 edition, this syntax is valid that is disallowed as of the 2018 edition.
9188
92-
* Notes that contain useful information about the state of the book or point out
93-
useful, but mostly out of scope, information are in blockquotes that start
94-
with the word "Note:" in **bold**.
89+
* Notes that contain useful information about the state of the book or point out useful, but mostly out of scope, information are in blockquotes that start with the word "Note:" in **bold**.
9590

9691
> **Note**: This is an example note.
9792
98-
* Warnings that show unsound behavior in the language or possibly confusing
99-
interactions of language features are in a special warning box.
93+
* Warnings that show unsound behavior in the language or possibly confusing interactions of language features are in a special warning box.
10094

10195
<div class="warning">
10296

@@ -106,8 +100,7 @@ information. These conventions are documented here.
106100

107101
* Code snippets inline in the text are inside `<code>` tags.
108102

109-
Longer code examples are in a syntax highlighted box that has controls for
110-
copying, executing, and showing hidden lines in the top right corner.
103+
Longer code examples are in a syntax highlighted box that has controls for copying, executing, and showing hidden lines in the top right corner.
111104

112105
```rust
113106
# // This is a hidden line.
@@ -116,8 +109,7 @@ information. These conventions are documented here.
116109
}
117110
```
118111

119-
* The grammar and lexical structure is in blockquotes with either "Lexer" or
120-
"Syntax" in <sup>**bold superscript**</sup> as the first line.
112+
* The grammar and lexical structure is in blockquotes with either "Lexer" or "Syntax" in <sup>**bold superscript**</sup> as the first line.
121113

122114
> **<sup>Syntax</sup>**\
123115
> _ExampleGrammar_:\
@@ -130,15 +122,10 @@ information. These conventions are documented here.
130122

131123
We welcome contributions of all kinds.
132124

133-
You can contribute to this book by opening an issue or sending a pull
134-
request to [the Rust Reference repository]. If this book does not answer
135-
your question, and you think its answer is in scope of it, please do not
136-
hesitate to [file an issue] or ask about it in the `t-lang/doc` stream on
137-
[Zulip]. Knowing what people use this book for the most helps direct our
138-
attention to making those sections the best that they can be. We also want
139-
the reference to be as normative as possible, so if you see anything that is
140-
wrong or is non-normative but not specifically called out, please also [file
141-
an issue].
125+
You can contribute to this book by opening an issue or sending a pull request to [the Rust Reference repository].
126+
If this book does not answer your question, and you think its answer is in scope of it, please do not hesitate to [file an issue] or ask about it in the `t-lang/doc` stream on [Zulip].
127+
Knowing what people use this book for the most helps direct our attention to making those sections the best that they can be.
128+
We also want the reference to be as normative as possible, so if you see anything that is wrong or is non-normative but not specifically called out, please also [file an issue].
142129

143130
[book]: ../book/index.html
144131
[github issues]: https://github.com/rust-lang/reference/issues

0 commit comments

Comments
 (0)