Skip to content

Commit 35dd675

Browse files
committed
---
yaml --- r: 130971 b: refs/heads/auto c: 38e7e4b h: refs/heads/master i: 130969: 61d8fe0 130967: 8dd0d2c v: v3
1 parent 0bb667f commit 35dd675

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+3620
-1091
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: 22e749ded10822a3063fa26800aaa3f229e97c4d
16+
refs/heads/auto: 38e7e4bd9c1e895be56077f4edd44263b6deea48
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ documentation.
66
## Quick Start
77

88
1. Download a [binary installer][installer] for your platform.
9-
2. Read the [guide].
9+
2. Read the [tutorial].
1010
3. Enjoy!
1111

1212
> ***Note:*** Windows users can read the detailed
1313
> [getting started][wiki-start] notes on the wiki.
1414
1515
[installer]: http://www.rust-lang.org/install.html
16-
[guide]: http://doc.rust-lang.org/guide.html
16+
[tutorial]: http://doc.rust-lang.org/tutorial.html
1717
[wiki-start]: https://github.com/rust-lang/rust/wiki/Note-getting-started-developing-Rust
1818
[win-wiki]: https://github.com/rust-lang/rust/wiki/Using-Rust-on-Windows
1919

@@ -54,7 +54,7 @@ documentation.
5454
When complete, `make install` will place several programs into
5555
`/usr/local/bin`: `rustc`, the Rust compiler, and `rustdoc`, the
5656
API-documentation tool.
57-
3. Read the [guide].
57+
3. Read the [tutorial].
5858
4. Enjoy!
5959

6060
### Building on Windows
@@ -76,7 +76,7 @@ To easily build on windows we can use [MSYS2](http://sourceforge.net/projects/ms
7676

7777
[repo]: https://github.com/rust-lang/rust
7878
[tarball]: https://static.rust-lang.org/dist/rust-nightly.tar.gz
79-
[guide]: http://doc.rust-lang.org/guide.html
79+
[tutorial]: http://doc.rust-lang.org/tutorial.html
8080

8181
## Notes
8282

branches/auto/mk/dist.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ PKG_EXE = dist/$(PKG_NAME)-$(CFG_BUILD).exe
123123
$(PKG_EXE): rust.iss modpath.iss upgrade.iss LICENSE.txt rust-logo.ico \
124124
$(CSREQ3_T_$(CFG_BUILD)_H_$(CFG_BUILD)) \
125125
dist-prepare-win
126-
$(CFG_PYTHON) $(S)src/etc/make-win-dist.py tmp/dist/win $(CFG_BUILD)
126+
$(CFG_PYTHON) $(S)src/etc/copy-runtime-deps.py tmp/dist/win/bin $(CFG_BUILD)
127127
@$(call E, ISCC: $@)
128128
$(Q)"$(CFG_ISCC)" $<
129129

branches/auto/mk/docs.mk

Lines changed: 12 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
# except according to those terms.
1010

1111
######################################################################
12-
# The various pieces of standalone documentation: guides, manual, etc
12+
# The various pieces of standalone documentation: guides, tutorial,
13+
# manual etc.
1314
#
1415
# The DOCS variable is their names (with no file extension).
1516
#
@@ -31,7 +32,7 @@ DOCS := index intro tutorial guide guide-ffi guide-macros guide-lifetimes \
3132
complement-lang-faq complement-design-faq complement-project-faq rust \
3233
rustdoc guide-unsafe guide-strings
3334

34-
PDF_DOCS := guide rust
35+
PDF_DOCS := tutorial rust
3536

3637
RUSTDOC_DEPS_rust := doc/full-toc.inc
3738
RUSTDOC_FLAGS_rust := --html-in-header=doc/full-toc.inc
@@ -75,22 +76,21 @@ endif
7576

7677
# Check for the various external utilities for the EPUB/PDF docs:
7778

78-
ifeq ($(CFG_LUALATEX),)
79-
$(info cfg: no lualatex found, deferring to xelatex)
79+
ifeq ($(CFG_PDFLATEX),)
80+
$(info cfg: no pdflatex found, deferring to xelatex)
8081
ifeq ($(CFG_XELATEX),)
81-
$(info cfg: no xelatex found, deferring to pdflatex)
82-
ifeq ($(CFG_PDFLATEX),)
83-
$(info cfg: no pdflatex found, disabling LaTeX docs)
82+
$(info cfg: no xelatex found, deferring to lualatex)
83+
ifeq ($(CFG_LUALATEX),)
84+
$(info cfg: no lualatex found, disabling LaTeX docs)
8485
NO_PDF_DOCS = 1
8586
else
86-
CFG_LATEX := $(CFG_PDFLATEX)
87+
CFG_LATEX := $(CFG_LUALATEX)
8788
endif
8889
else
8990
CFG_LATEX := $(CFG_XELATEX)
90-
XELATEX = 1
9191
endif
9292
else
93-
CFG_LATEX := $(CFG_LUALATEX)
93+
CFG_LATEX := $(CFG_PDFLATEX)
9494
endif
9595

9696

@@ -187,25 +187,12 @@ doc/$(1).tex: $$(D)/$(1).md doc/footer.tex doc/version.tex | doc/
187187
ifneq ($(NO_PDF_DOCS),1)
188188
ifeq ($$(SHOULD_BUILD_PDF_DOC_$(1)),1)
189189
DOC_TARGETS += doc/$(1).pdf
190-
ifneq ($(XELATEX),1)
191190
doc/$(1).pdf: doc/$(1).tex
192191
@$$(call E, latex compiler: $$@)
193192
$$(Q)$$(CFG_LATEX) \
194193
-interaction=batchmode \
195194
-output-directory=doc \
196195
$$<
197-
else
198-
# The version of xelatex on the snap bots seemingly ingores -output-directory
199-
# So we'll output to . and move to the doc directory manually.
200-
# This will leave some intermediate files in the build directory.
201-
doc/$(1).pdf: doc/$(1).tex
202-
@$$(call E, latex compiler: $$@)
203-
$$(Q)$$(CFG_LATEX) \
204-
-interaction=batchmode \
205-
-output-directory=. \
206-
$$<
207-
$$(Q)mv ./$(1).pdf $$@
208-
endif # XELATEX
209196
endif # SHOULD_BUILD_PDF_DOCS_$(1)
210197
endif # NO_PDF_DOCS
211198

@@ -225,7 +212,7 @@ $(foreach docname,$(DOCS),$(eval $(call DEF_DOC,$(docname))))
225212
#
226213
# As such, I've attempted to get it working as much as possible (and
227214
# switching from pandoc to rustdoc), but preserving the old behaviour
228-
# (e.g. only running on the guide)
215+
# (e.g. only running on the tutorial)
229216
.PHONY: l10n-mds
230217
l10n-mds: $(D)/po4a.conf \
231218
$(foreach lang,$(L10N_LANG),$(D)/po/$(lang)/*.md.po)
@@ -243,7 +230,7 @@ doc/l10n/$(1)/$(2).html: l10n-mds $$(HTML_DEPS) $$(RUSTDOC_DEPS_$(2))
243230
$$(RUSTDOC) $$(RUSTDOC_HTML_OPTS) $$(RUSTDOC_FLAGS_$(1)) doc/l10n/$(1)/$(2).md
244231
endef
245232

246-
$(foreach lang,$(L10N_LANGS),$(eval $(call DEF_L10N_DOC,$(lang),guide)))
233+
$(foreach lang,$(L10N_LANGS),$(eval $(call DEF_L10N_DOC,$(lang),tutorial)))
247234

248235

249236
######################################################################

branches/auto/src/doc/guide.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
% The Rust Guide
22

3+
<div style="border: 2px solid red; padding:5px;">
4+
This guide is a work in progress. Until it is ready, we highly recommend that
5+
you read the <a href="tutorial.html">Tutorial</a> instead. This work-in-progress Guide is being
6+
displayed here in line with Rust's open development policy. Please open any
7+
issues you find as usual.
8+
</div>
9+
10+
# Welcome!
11+
312
Hey there! Welcome to the Rust guide. This is the place to be if you'd like to
413
learn how to program in Rust. Rust is a systems programming language with a
514
focus on "high-level, bare-metal programming": the lowest level control a
@@ -110,7 +119,7 @@ The first thing that we need to do is make a file to put our code in. I like
110119
to make a `projects` directory in my home directory, and keep all my projects
111120
there. Rust does not care where your code lives.
112121

113-
This actually leads to one other concern we should address: this guide will
122+
This actually leads to one other concern we should address: this tutorial will
114123
assume that you have basic familiarity with the command line. Rust does not
115124
require that you know a whole ton about the command line, but until the
116125
language is in a more finished state, IDE support is spotty. Rust makes no
@@ -206,7 +215,7 @@ Finally, the line ends with a semicolon (`;`). Rust is an **expression
206215
oriented** language, which means that most things are expressions. The `;` is
207216
used to indicate that this expression is over, and the next one is ready to
208217
begin. Most lines of Rust code end with a `;`. We will cover this in-depth
209-
later in the guide.
218+
later in the tutorial.
210219

211220
Finally, actually **compiling** and **running** our program. We can compile
212221
with our compiler, `rustc`, by passing it the name of our source file:
@@ -2008,7 +2017,7 @@ Great! Next up: let's compare our guess to the secret guess.
20082017

20092018
## Comparing guesses
20102019

2011-
If you remember, earlier in the guide, we made a `cmp` function that compared
2020+
If you remember, earlier in the tutorial, we made a `cmp` function that compared
20122021
two numbers. Let's add that in, along with a `match` statement to compare the
20132022
guess to the secret guess:
20142023

branches/auto/src/doc/index.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,6 @@ discussion about Rust.
4343
There is also a [developer forum](http://discuss.rust-lang.org/), where the
4444
development of Rust itself is discussed.
4545

46-
# Specification
47-
48-
Rust does not have an exact specification, but an effort to describe as much of
49-
the language in as much detail as possible is in [the manual](rust.html).
5046

5147
# Guides
5248

branches/auto/src/doc/intro.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ Rust is a systems programming language that combines strong compile-time correct
44
It improves upon the ideas of other systems languages like C++
55
by providing guaranteed memory safety (no crashes, no data races) and complete control over the lifecycle of memory.
66
Strong memory guarantees make writing correct concurrent Rust code easier than in other languages.
7-
This introduction will give you an idea of what Rust is like in about thirty minutes.
7+
This tutorial will give you an idea of what Rust is like in about thirty minutes.
88
It expects that you're at least vaguely familiar with a previous 'curly brace' language,
99
but does not require prior experience with systems programming.
1010
The concepts are more important than the syntax,
1111
so don't worry if you don't get every last detail:
12-
the [guide](guide.html) can help you out with that later.
12+
the [tutorial](tutorial.html) can help you out with that later.
1313

1414
Let's talk about the most important concept in Rust, "ownership,"
1515
and its implications on a task that programmers usually find very difficult: concurrency.
@@ -433,5 +433,5 @@ yet get the efficiency of languages such as C++.
433433

434434
I hope that this taste of Rust has given you an idea if Rust is the right language for you.
435435
If that's true,
436-
I encourage you to check out [the guide](guide.html) for a full,
436+
I encourage you to check out [the tutorial](tutorial.html) for a full,
437437
in-depth exploration of Rust's syntax and concepts.

branches/auto/src/doc/po4a.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@
2424
[type: text] src/doc/intro.md $lang:doc/l10n/$lang/intro.md
2525
[type: text] src/doc/rust.md $lang:doc/l10n/$lang/rust.md
2626
[type: text] src/doc/rustdoc.md $lang:doc/l10n/$lang/rustdoc.md
27-
[type: text] src/doc/guide.md $lang:doc/l10n/$lang/guide.md
27+
[type: text] src/doc/tutorial.md $lang:doc/l10n/$lang/tutorial.md

branches/auto/src/doc/rust.md

Lines changed: 24 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@ provides three kinds of material:
1313
- Appendix chapters providing rationale and references to languages that
1414
influenced the design.
1515

16-
This document does not serve as an introduction to the
16+
This document does not serve as a tutorial introduction to the
1717
language. Background familiarity with the language is assumed. A separate
18-
[guide] is available to help acquire such background familiarity.
18+
[tutorial] document is available to help acquire such background familiarity.
1919

2020
This document also does not serve as a reference to the [standard]
2121
library included in the language distribution. Those libraries are
2222
documented separately by extracting documentation attributes from their
2323
source code.
2424

25-
[guide]: guide.html
25+
[tutorial]: tutorial.html
2626
[standard]: std/index.html
2727

2828
## Disclaimer
@@ -349,7 +349,7 @@ enclosed within two `U+0022` (double-quote) characters,
349349
with the exception of `U+0022` itself,
350350
which must be _escaped_ by a preceding `U+005C` character (`\`),
351351
or a _raw byte string literal_.
352-
It is equivalent to a `&'static [u8]` borrowed array of unsigned 8-bit integers.
352+
It is equivalent to a `&'static [u8]` borrowed vector of unsigned 8-bit integers.
353353

354354
Some additional _escapes_ are available in either byte or non-raw byte string
355355
literals. An escape starts with a `U+005C` (`\`) and continues with one of
@@ -2555,8 +2555,6 @@ The currently implemented features of the reference compiler are:
25552555
which is considered wildly unsafe and will be
25562556
obsoleted by language improvements.
25572557

2558-
* `tuple_indexing` - Allows use of tuple indexing (expressions like `expr.0`)
2559-
25602558
If a feature is promoted to a language feature, then all existing programs will
25612559
start to receive compilation warnings about #[feature] directives which enabled
25622560
the new feature (because the directive is no longer necessary). However, if
@@ -2811,17 +2809,16 @@ When the type providing the field inherits mutabilty, it can be [assigned](#assi
28112809
Also, if the type of the expression to the left of the dot is a pointer,
28122810
it is automatically dereferenced to make the field access possible.
28132811

2814-
### Array expressions
2812+
### Vector expressions
28152813

28162814
~~~~ {.ebnf .gram}
2817-
array_expr : '[' "mut" ? vec_elems? ']' ;
2815+
vec_expr : '[' "mut" ? vec_elems? ']' ;
28182816
2819-
array_elems : [expr [',' expr]*] | [expr ',' ".." expr] ;
2817+
vec_elems : [expr [',' expr]*] | [expr ',' ".." expr] ;
28202818
~~~~
28212819

2822-
An [array](#vector,-array,-and-slice-types) _expression_ is written by
2823-
enclosing zero or more comma-separated expressions of uniform type in square
2824-
brackets.
2820+
A [_vector_](#vector-types) _expression_ is written by enclosing zero or
2821+
more comma-separated expressions of uniform type in square brackets.
28252822

28262823
In the `[expr ',' ".." expr]` form, the expression after the `".."`
28272824
must be a constant expression that can be evaluated at compile time, such
@@ -2830,7 +2827,7 @@ as a [literal](#literals) or a [static item](#static-items).
28302827
~~~~
28312828
[1i, 2, 3, 4];
28322829
["a", "b", "c", "d"];
2833-
[0i, ..128]; // array with 128 zeros
2830+
[0i, ..128]; // vector with 128 zeros
28342831
[0u8, 0u8, 0u8, 0u8];
28352832
~~~~
28362833

@@ -2840,9 +2837,9 @@ as a [literal](#literals) or a [static item](#static-items).
28402837
idx_expr : expr '[' expr ']' ;
28412838
~~~~
28422839

2843-
[Array](#vector,-array,-and-slice-types)-typed expressions can be indexed by writing a
2840+
[Vector](#vector-types)-typed expressions can be indexed by writing a
28442841
square-bracket-enclosed expression (the index) after them. When the
2845-
array is mutable, the resulting [lvalue](#lvalues,-rvalues-and-temporaries) can be assigned to.
2842+
vector is mutable, the resulting [lvalue](#lvalues,-rvalues-and-temporaries) can be assigned to.
28462843

28472844
Indices are zero-based, and may be of any integral type. Vector access
28482845
is bounds-checked at run-time. When the check fails, it will put the
@@ -2903,7 +2900,7 @@ This means that arithmetic operators can be overridden for user-defined types.
29032900
The default meaning of the operators on standard types is given here.
29042901

29052902
* `+`
2906-
: Addition and array/string concatenation.
2903+
: Addition and vector/string concatenation.
29072904
Calls the `add` method on the `std::ops::Add` trait.
29082905
* `-`
29092906
: Subtraction.
@@ -3206,7 +3203,7 @@ for_expr : "for" pat "in" no_struct_literal_expr '{' block '}' ;
32063203
A `for` expression is a syntactic construct for looping over elements
32073204
provided by an implementation of `std::iter::Iterator`.
32083205

3209-
An example of a for loop over the contents of an array:
3206+
An example of a for loop over the contents of a vector:
32103207

32113208
~~~~
32123209
# type Foo = int;
@@ -3264,7 +3261,7 @@ match_pat : pat [ '|' pat ] * [ "if" expr ] ? ;
32643261

32653262
A `match` expression branches on a *pattern*. The exact form of matching that
32663263
occurs depends on the pattern. Patterns consist of some combination of
3267-
literals, destructured arrays or enum constructors, structures and
3264+
literals, destructured vectors or enum constructors, structures and
32683265
tuples, variable binding specifications, wildcards (`..`), and placeholders
32693266
(`_`). A `match` expression has a *head expression*, which is the value to
32703267
compare to the patterns. The type of the patterns must equal the type of the
@@ -3293,11 +3290,11 @@ between `_` and `..` is that the pattern `C(_)` is only type-correct if `C` has
32933290
exactly one argument, while the pattern `C(..)` is type-correct for any enum
32943291
variant `C`, regardless of how many arguments `C` has.
32953292

3296-
Used inside a array pattern, `..` stands for any number of elements, when the
3293+
Used inside a vector pattern, `..` stands for any number of elements, when the
32973294
`advanced_slice_patterns` feature gate is turned on. This wildcard can be used
3298-
at most once for a given array, which implies that it cannot be used to
3295+
at most once for a given vector, which implies that it cannot be used to
32993296
specifically match elements that are at an unknown distance from both ends of a
3300-
array, like `[.., 42, ..]`. If followed by a variable name, it will bind the
3297+
vector, like `[.., 42, ..]`. If followed by a variable name, it will bind the
33013298
corresponding slice to the variable. Example:
33023299

33033300
~~~~
@@ -3430,7 +3427,7 @@ let message = match x {
34303427
~~~~
34313428

34323429
Range patterns only work on scalar types
3433-
(like integers and characters; not like arrays and structs, which have sub-components).
3430+
(like integers and characters; not like vectors and structs, which have sub-components).
34343431
A range pattern may not be a sub-range of another range pattern inside the same `match`.
34353432

34363433
Finally, match patterns can accept *pattern guards* to further refine the
@@ -3538,10 +3535,10 @@ http://www.unicode.org/glossary/#unicode_scalar_value)
35383535
(ie. a code point that is not a surrogate),
35393536
represented as a 32-bit unsigned word in the 0x0000 to 0xD7FF
35403537
or 0xE000 to 0x10FFFF range.
3541-
A `[char]` array is effectively an UCS-4 / UTF-32 string.
3538+
A `[char]` vector is effectively an UCS-4 / UTF-32 string.
35423539

35433540
A value of type `str` is a Unicode string,
3544-
represented as a array of 8-bit unsigned bytes holding a sequence of UTF-8 codepoints.
3541+
represented as a vector of 8-bit unsigned bytes holding a sequence of UTF-8 codepoints.
35453542
Since `str` is of unknown size, it is not a _first class_ type,
35463543
but can only be instantiated through a pointer type,
35473544
such as `&str` or `String`.
@@ -3652,7 +3649,7 @@ Such recursion has restrictions:
36523649

36533650
* Recursive types must include a nominal type in the recursion
36543651
(not mere [type definitions](#type-definitions),
3655-
or other structural types such as [arrays](#vector,-array,-and-slice-types) or [tuples](#tuple-types)).
3652+
or other structural types such as [vectors](#vector-types) or [tuples](#tuple-types)).
36563653
* A recursive `enum` item must have at least one non-recursive constructor
36573654
(in order to give the recursion a basis case).
36583655
* The size of a recursive type must be finite;
@@ -4156,7 +4153,7 @@ heap data.
41564153
### Built in types
41574154

41584155
The runtime provides C and Rust code to assist with various built-in types,
4159-
such as arrays, strings, and the low level communication system (ports,
4156+
such as vectors, strings, and the low level communication system (ports,
41604157
channels, tasks).
41614158

41624159
Support for other built-in types such as simple types, tuples and
@@ -4175,7 +4172,7 @@ communication facilities.
41754172
The Rust compiler supports various methods to link crates together both
41764173
statically and dynamically. This section will explore the various methods to
41774174
link Rust crates together, and more information about native libraries can be
4178-
found in the [ffi guide][ffi].
4175+
found in the [ffi tutorial][ffi].
41794176

41804177
In one session of compilation, the compiler can generate multiple artifacts
41814178
through the usage of either command line flags or the `crate_type` attribute.

0 commit comments

Comments
 (0)