@@ -9,7 +9,7 @@ provides three kinds of material:
9
9
- Appendix chapters providing rationale and references to languages that
10
10
influenced the design.
11
11
12
- You may also be interested in the [ grammar] .
12
+ > ** Note ** : You may also be interested in the [ grammar] .
13
13
14
14
<div class =" warning " >
15
15
@@ -44,13 +44,76 @@ specific to `rustc` itself, and should not be taken as a specification for
44
44
the Rust language. We intend to produce such a document someday, and until then,
45
45
the reference is the closest thing we have to one.
46
46
47
- ## How to Read The Reference
47
+ ## How to Use This Book
48
48
49
- You sould not read this document sequentially. As a reference document, you
50
- should skim the table of contents until you find the section you are interested
51
- in and read that section. If you are viewing this in a browser and have
52
- JavaScript enabled, you can also press ` s ` or click the magnifying glass on the
53
- top bar to open a search bar.
49
+ This book does not assume you are reading this document sequentially. Each
50
+ chapter generally can be read standalone, but will cross-link to other chapters
51
+ for facets of the language they refer to, but do not discuss.
52
+
53
+ There are two main ways to read this document.
54
+
55
+ The first is to answer a specific question. If you know which chapter answers
56
+ that question, you can jump to that chapter in the table of contents. Otherwise,
57
+ you can press ` s ` or the click the magnifying glass on the top bar to search for
58
+ keywords related to your question. For example, say you wanted to know when a
59
+ temporary value created in a let statement is dropped. If you didn't already
60
+ know that the [ lifetime of temporaries] is defined in the [ expressions chapter] ,
61
+ you could search "temporary let" and the first search result will take you to
62
+ that section.
63
+
64
+ The second is to generally improve your knowledge of a facet of the language.
65
+ In that case, just browse the table of contents until you see something you
66
+ want to know more about, and just start reading. If a link looks interesting,
67
+ click it, and read about that section.
68
+
69
+ That said, there is no wrong way to read this book. Read it however you feel
70
+ helps you best.
71
+
72
+ ### Conventions
73
+
74
+ Like all technical books, this book has certain conventions in how it displays
75
+ information. These conventions are documented here.
76
+
77
+ * Statements that define a term contain that term in * italics* . Whenever that
78
+ term is used outside of that chapter, it is usually a link to the section that
79
+ has this definition.
80
+
81
+ An * example term* is an example of a term beind defined.
82
+
83
+ * Notes that contain useful information about the state of the book or point out
84
+ useful, but mostly out of scope, information are in blockquotes that start with
85
+ the word "Note:" in ** bold** .
86
+
87
+ > Note: This is an example note.
88
+
89
+ * Warnings that show unsound behavior in the language or possibly confusing
90
+ interactions of language features are in a special warning box.
91
+
92
+ <div class =" warning " >
93
+
94
+ Warning: This is an example warning.
95
+
96
+ </div >
97
+
98
+ * Code snippets inline in the text are inside ` <code> ` tags.
99
+
100
+ Longer code examples are in a syntax highlighted box that has controls for
101
+ copying, executing, and showing hidden lines in the top right corner.
102
+
103
+ ``` rust
104
+ # // This is a hidden line.
105
+ fn main () {
106
+ println! (" This is a code example" );
107
+ }
108
+ ```
109
+
110
+ * The grammar and lexical structure is in blockquotes with either "Lexer" or
111
+ "Syntax" in ** bold** as the first line in <sup >superscript</sup >.
112
+
113
+ > ** <sup >Syntax</sup >** \
114
+ > _ ExampleGrammar_ :\
115
+ >   ;  ;   ;  ; ` ~ ` [ _ Expression_ ] \
116
+ >   ;  ; | ` box ` [ _ Expression_ ]
54
117
55
118
## Contributing
56
119
@@ -69,6 +132,9 @@ attention to making those sections the best that they can be.
69
132
[ the Rust Reference repository ] : https://github.com/rust-lang-nursery/reference/
70
133
[ big issue ] : https://github.com/rust-lang-nursery/reference/issues/9
71
134
[ Unstable Book ] : https://doc.rust-lang.org/nightly/unstable-book/
135
+ [ _Expression_ ] : expressions.html
72
136
[ cargo book ] : ../cargo/index.html
73
137
[ cargo reference ] : ../cargo/reference/index.html
138
+ [ expressions chapter ] : expressions.html
139
+ [ lifetime of temporaries ] : expressions.html#temporary-lifetimes
74
140
[ linkage ] : linkage.html
0 commit comments