Skip to content

Commit c5db290

Browse files
committed
Auto merge of #22367 - Manishearth:rollup, r=steveklabnik
(still testing locally)
2 parents 342ab53 + cea2bbf commit c5db290

File tree

122 files changed

+1012
-517
lines changed

Some content is hidden

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

122 files changed

+1012
-517
lines changed

README.md

+2-11
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,10 @@ documentation.
55

66
## Quick Start
77

8-
1. Download a [binary installer][installer] for your platform.
9-
2. Read [The Rust Programming Language][trpl].
10-
3. Enjoy!
8+
Read ["Installing Rust"][install] from [The Book][trpl].
119

12-
> ***Note:*** Windows users can read the detailed
13-
> [using Rust on Windows][win-wiki] notes on the wiki.
14-
15-
[installer]: http://www.rust-lang.org/install.html
10+
[install]: http://doc.rust-lang.org/book/installing-rust.html
1611
[trpl]: http://doc.rust-lang.org/book/index.html
17-
[win-wiki]: https://github.com/rust-lang/rust/wiki/Using-Rust-on-Windows
1812

1913
## Building from Source
2014

@@ -52,8 +46,6 @@ documentation.
5246
When complete, `make install` will place several programs into
5347
`/usr/local/bin`: `rustc`, the Rust compiler, and `rustdoc`, the
5448
API-documentation tool.
55-
3. Read [The Rust Programming Language][trpl].
56-
4. Enjoy!
5749

5850
### Building on Windows
5951

@@ -81,7 +73,6 @@ $ pacman -S base-devel
8173

8274
[repo]: https://github.com/rust-lang/rust
8375
[tarball]: https://static.rust-lang.org/dist/rustc-nightly-src.tar.gz
84-
[trpl]: http://doc.rust-lang.org/book/index.html
8576

8677
## Notes
8778

mk/dist.mk

+11-10
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,6 @@ distcheck-tar-src: dist-tar-src
109109
# Unix binary installer tarballs
110110
######################################################################
111111

112-
NON_INSTALLED_PREFIXES=COPYRIGHT,LICENSE-APACHE,LICENSE-MIT,README.md,version
113-
114112
define DEF_INSTALLER
115113

116114
$$(eval $$(call DEF_PREPARE,dir-$(1)))
@@ -124,19 +122,23 @@ dist-install-dir-$(1): PREPARE_LIB_CMD=$(DEFAULT_PREPARE_LIB_CMD)
124122
dist-install-dir-$(1): PREPARE_MAN_CMD=$(DEFAULT_PREPARE_MAN_CMD)
125123
dist-install-dir-$(1): PREPARE_CLEAN=true
126124
dist-install-dir-$(1): prepare-base-dir-$(1) docs compiler-docs
127-
$$(Q)$$(PREPARE_MAN_CMD) $$(S)COPYRIGHT $$(PREPARE_DEST_DIR)
128-
$$(Q)$$(PREPARE_MAN_CMD) $$(S)LICENSE-APACHE $$(PREPARE_DEST_DIR)
129-
$$(Q)$$(PREPARE_MAN_CMD) $$(S)LICENSE-MIT $$(PREPARE_DEST_DIR)
130-
$$(Q)$$(PREPARE_MAN_CMD) $$(S)README.md $$(PREPARE_DEST_DIR)
131125
$$(Q)mkdir -p $$(PREPARE_DEST_DIR)/share/doc/rust
132126
$$(Q)$$(PREPARE_MAN_CMD) $$(S)COPYRIGHT $$(PREPARE_DEST_DIR)/share/doc/rust
133127
$$(Q)$$(PREPARE_MAN_CMD) $$(S)LICENSE-APACHE $$(PREPARE_DEST_DIR)/share/doc/rust
134128
$$(Q)$$(PREPARE_MAN_CMD) $$(S)LICENSE-MIT $$(PREPARE_DEST_DIR)/share/doc/rust
135129
$$(Q)$$(PREPARE_MAN_CMD) $$(S)README.md $$(PREPARE_DEST_DIR)/share/doc/rust
130+
131+
prepare-overlay-$(1):
132+
$$(Q)rm -Rf tmp/dist/$$(PKG_NAME)-$(1)-overlay
133+
$$(Q)mkdir -p tmp/dist/$$(PKG_NAME)-$(1)-overlay
134+
$$(Q)cp $$(S)COPYRIGHT tmp/dist/$$(PKG_NAME)-$(1)-overlay/
135+
$$(Q)cp $$(S)LICENSE-APACHE tmp/dist/$$(PKG_NAME)-$(1)-overlay/
136+
$$(Q)cp $$(S)LICENSE-MIT tmp/dist/$$(PKG_NAME)-$(1)-overlay/
137+
$$(Q)cp $$(S)README.md tmp/dist/$$(PKG_NAME)-$(1)-overlay/
136138
# This tiny morsel of metadata is used by rust-packaging
137-
$$(Q)echo "$(CFG_VERSION)" > $$(PREPARE_DEST_DIR)/version
139+
$$(Q)echo "$(CFG_VERSION)" > tmp/dist/$$(PKG_NAME)-$(1)-overlay/version
138140

139-
dist/$$(PKG_NAME)-$(1).tar.gz: dist-install-dir-$(1)
141+
dist/$$(PKG_NAME)-$(1).tar.gz: dist-install-dir-$(1) prepare-overlay-$(1)
140142
@$(call E, build: $$@)
141143
# Copy essential gcc components into installer
142144
ifdef CFG_WINDOWSY_$(1)
@@ -146,13 +148,12 @@ ifdef CFG_WINDOWSY_$(1)
146148
endif
147149
$$(Q)$$(S)src/rust-installer/gen-installer.sh \
148150
--product-name=Rust \
149-
--verify-bin=rustc \
150151
--rel-manifest-dir=rustlib \
151152
--success-message=Rust-is-ready-to-roll. \
152153
--image-dir=tmp/dist/$$(PKG_NAME)-$(1)-image \
153154
--work-dir=tmp/dist \
154155
--output-dir=dist \
155-
--non-installed-prefixes=$$(NON_INSTALLED_PREFIXES) \
156+
--non-installed-overlay=tmp/dist/$$(PKG_NAME)-$(1)-overlay \
156157
--package-name=$$(PKG_NAME)-$(1) \
157158
--component-name=rustc \
158159
--legacy-manifest-dirs=rustlib,cargo

mk/docs.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
######################################################################
2828
DOCS := index intro tutorial complement-bugreport \
2929
complement-lang-faq complement-design-faq complement-project-faq \
30-
rustdoc reference
30+
rustdoc reference grammar
3131

3232
# Legacy guides, preserved for a while to reduce the number of 404s
3333
DOCS += guide-crates guide-error-handling guide-ffi guide-macros guide \

mk/main.mk

+8-4
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ CFG_RELEASE_NUM=1.0.0
1818
# An optional number to put after the label, e.g. '.2' -> '-beta.2'
1919
# NB Make sure it starts with a dot to conform to semver pre-release
2020
# versions (section 9)
21-
CFG_PRERELEASE_VERSION=.1
21+
CFG_PRERELEASE_VERSION=.2
2222

2323
CFG_FILENAME_EXTRA=4e7c5e5c
2424

@@ -30,8 +30,8 @@ CFG_PACKAGE_VERS=$(CFG_RELEASE_NUM)
3030
CFG_DISABLE_UNSTABLE_FEATURES=1
3131
endif
3232
ifeq ($(CFG_RELEASE_CHANNEL),beta)
33-
CFG_RELEASE=$(CFG_RELEASE_NUM)-beta$(CFG_PRERELEASE_VERSION)
34-
CFG_PACKAGE_VERS=$(CFG_RELEASE_NUM)-beta$(CFG_PRERELEASE_VERSION)
33+
CFG_RELEASE=$(CFG_RELEASE_NUM)-alpha$(CFG_PRERELEASE_VERSION)
34+
CFG_PACKAGE_VERS=$(CFG_RELEASE_NUM)-alpha$(CFG_PRERELEASE_VERSION)
3535
CFG_DISABLE_UNSTABLE_FEATURES=1
3636
endif
3737
ifeq ($(CFG_RELEASE_CHANNEL),nightly)
@@ -61,13 +61,16 @@ SPACE :=
6161
SPACE +=
6262
ifneq ($(CFG_GIT),)
6363
ifneq ($(wildcard $(subst $(SPACE),\$(SPACE),$(CFG_GIT_DIR))),)
64-
CFG_VER_DATE = $(shell git --git-dir='$(CFG_GIT_DIR)' log -1 --pretty=format:'%ci')
64+
CFG_VER_DATE = $(shell git --git-dir='$(CFG_GIT_DIR)' log -1 --date=short --pretty=format:'%cd')
6565
CFG_VER_HASH = $(shell git --git-dir='$(CFG_GIT_DIR)' rev-parse HEAD)
6666
CFG_SHORT_VER_HASH = $(shell git --git-dir='$(CFG_GIT_DIR)' rev-parse --short=9 HEAD)
6767
CFG_VERSION += ($(CFG_SHORT_VER_HASH) $(CFG_VER_DATE))
6868
endif
6969
endif
7070

71+
CFG_BUILD_DATE = $(shell date +%F)
72+
CFG_VERSION += (built $(CFG_BUILD_DATE))
73+
7174
# Windows exe's need numeric versions - don't use anything but
7275
# numbers and dots here
7376
CFG_VERSION_WIN = $(CFG_RELEASE_NUM)
@@ -317,6 +320,7 @@ endif
317320
ifdef CFG_VER_HASH
318321
export CFG_VER_HASH
319322
endif
323+
export CFG_BUILD_DATE
320324
export CFG_VERSION
321325
export CFG_VERSION_WIN
322326
export CFG_RELEASE

src/compiletest/compiletest.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#![feature(io)]
1717
#![feature(path)]
1818
#![feature(rustc_private)]
19-
#![feature(slicing_syntax, unboxed_closures)]
19+
#![feature(unboxed_closures)]
2020
#![feature(std_misc)]
2121
#![feature(test)]
2222
#![feature(unicode)]

src/doc/complement-bugreport.md

+3-5
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@ $ RUST_BACKTRACE=1 rustc ...
5656

5757
# I submitted a bug, but nobody has commented on it!
5858

59-
This is sad, but does happen sometimes, since we're short-staffed. If you
60-
submit a bug and you haven't received a comment on it within 3 business days,
61-
it's entirely reasonable to either ask on the #rust IRC channel,
62-
or post on the [rust-dev mailing list](https://mail.mozilla.org/listinfo/rust-dev)
63-
to ask what the status of the bug is.
59+
This is sad, but does happen sometimes, since we're short-staffed. If you submit a
60+
bug and you haven't received a comment on it within 3 business days, it's entirely
61+
reasonable to ask about the status of the bug in #rust on irc.mozilla.org.

src/doc/grammar.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
# **This is a work in progress**
2-
3-
% The Rust Grammar
1+
% Grammar
42

53
# Introduction
64

@@ -570,7 +568,7 @@ binop_expr : expr binop expr ;
570568
The precedence of Rust binary operators is ordered as follows, going from
571569
strong to weak:
572570

573-
```
571+
```text
574572
* / %
575573
as
576574
+ -

src/doc/intro.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ segfault when we allocate more memory?
224224

225225
The answer is that in the C++ version, `x` is a *reference* to the memory
226226
location where the first element of the array is stored. But in Ruby, `x` is a
227-
standalone value, not connected to the underyling array at all. Let's dig into
227+
standalone value, not connected to the underlying array at all. Let's dig into
228228
the details for a moment. Your program has access to memory, provided to it by
229229
the operating system. Each location in memory has an address. So when we make
230230
our vector, `v`, it's stored in a memory location somewhere:

src/doc/reference.md

+71-22
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
This document is the primary reference for the Rust programming language. It
66
provides three kinds of material:
77

8-
- Chapters that formally define the language grammar and, for each
9-
construct, informally describe its semantics and give examples of its
10-
use.
8+
- Chapters that informally describe each language construct and their use.
119
- Chapters that informally describe the memory model, concurrency model,
1210
runtime services, linkage model and debugging facilities.
1311
- Appendix chapters providing rationale and references to languages that
@@ -23,8 +21,11 @@ separately by extracting documentation attributes from their source code. Many
2321
of the features that one might expect to be language features are library
2422
features in Rust, so what you're looking for may be there, not here.
2523

24+
You may also be interested in the [grammar].
25+
2626
[book]: book/index.html
2727
[standard]: std/index.html
28+
[grammar]: grammar.html
2829

2930
# Notation
3031

@@ -2377,21 +2378,33 @@ considered off, and using the features will result in a compiler error.
23772378

23782379
The currently implemented features of the reference compiler are:
23792380

2381+
* `advanced_slice_patterns` - see the [match expressions](#match-expressions)
2382+
section for discussion; the exact semantics of
2383+
slice patterns are subject to change.
2384+
23802385
* `asm` - The `asm!` macro provides a means for inline assembly. This is often
23812386
useful, but the exact syntax for this feature along with its
23822387
semantics are likely to change, so this macro usage must be opted
23832388
into.
23842389

2390+
* `associated_types` - Allows type aliases in traits. Experimental.
2391+
2392+
* `box_patterns` - Allows `box` patterns, the exact semantics of which
2393+
is subject to change.
2394+
2395+
* `box_syntax` - Allows use of `box` expressions, the exact semantics of which
2396+
is subject to change.
2397+
23852398
* `concat_idents` - Allows use of the `concat_idents` macro, which is in many
23862399
ways insufficient for concatenating identifiers, and may be
23872400
removed entirely for something more wholesome.
23882401

2389-
* `default_type_params` - Allows use of default type parameters. The future of
2390-
this feature is uncertain.
2391-
23922402
* `intrinsics` - Allows use of the "rust-intrinsics" ABI. Compiler intrinsics
23932403
are inherently unstable and no promise about them is made.
23942404

2405+
* `int_uint` - Allows the use of the `int` and `uint` types, which are deprecated.
2406+
Use `isize` and `usize` instead.
2407+
23952408
* `lang_items` - Allows use of the `#[lang]` attribute. Like `intrinsics`,
23962409
lang items are inherently unstable and no promise about them
23972410
is made.
@@ -2410,12 +2423,33 @@ The currently implemented features of the reference compiler are:
24102423
* `log_syntax` - Allows use of the `log_syntax` macro attribute, which is a
24112424
nasty hack that will certainly be removed.
24122425

2426+
* `main` - Allows use of the `#[main]` attribute, which changes the entry point
2427+
into a Rust program. This capabiilty is subject to change.
2428+
2429+
* `macro_reexport` - Allows macros to be re-exported from one crate after being imported
2430+
from another. This feature was originally designed with the sole
2431+
use case of the Rust standard library in mind, and is subject to
2432+
change.
2433+
24132434
* `non_ascii_idents` - The compiler supports the use of non-ascii identifiers,
24142435
but the implementation is a little rough around the
24152436
edges, so this can be seen as an experimental feature
24162437
for now until the specification of identifiers is fully
24172438
fleshed out.
24182439

2440+
* `no_std` - Allows the `#![no_std]` crate attribute, which disables the implicit
2441+
`extern crate std`. This typically requires use of the unstable APIs
2442+
behind the libstd "facade", such as libcore and libcollections. It
2443+
may also cause problems when using syntax extensions, including
2444+
`#[derive]`.
2445+
2446+
* `on_unimplemented` - Allows the `#[rustc_on_unimplemented]` attribute, which allows
2447+
trait definitions to add specialized notes to error messages
2448+
when an implementation was expected but not found.
2449+
2450+
* `optin_builtin_traits` - Allows the definition of default and negative trait
2451+
implementations. Experimental.
2452+
24192453
* `plugin` - Usage of [compiler plugins][plugin] for custom lints or syntax extensions.
24202454
These depend on compiler internals and are subject to change.
24212455

@@ -2431,8 +2465,15 @@ The currently implemented features of the reference compiler are:
24312465
* `simd` - Allows use of the `#[simd]` attribute, which is overly simple and
24322466
not the SIMD interface we want to expose in the long term.
24332467

2468+
* `simd_ffi` - Allows use of SIMD vectors in signatures for foreign functions.
2469+
The SIMD interface is subject to change.
2470+
24342471
* `staged_api` - Allows usage of stability markers and `#![staged_api]` in a crate
24352472

2473+
* `start` - Allows use of the `#[start]` attribute, which changes the entry point
2474+
into a Rust program. This capabiilty, especially the signature for the
2475+
annotated function, is subject to change.
2476+
24362477
* `struct_inherit` - Allows using struct inheritance, which is barely
24372478
implemented and will probably be removed. Don't use this.
24382479

@@ -2460,18 +2501,20 @@ The currently implemented features of the reference compiler are:
24602501
which is considered wildly unsafe and will be
24612502
obsoleted by language improvements.
24622503

2504+
* `unsafe_no_drop_flag` - Allows use of the `#[unsafe_no_drop_flag]` attribute,
2505+
which removes hidden flag added to a type that
2506+
implements the `Drop` trait. The design for the
2507+
`Drop` flag is subject to change, and this feature
2508+
may be removed in the future.
2509+
24632510
* `unmarked_api` - Allows use of items within a `#![staged_api]` crate
24642511
which have not been marked with a stability marker.
24652512
Such items should not be allowed by the compiler to exist,
24662513
so if you need this there probably is a compiler bug.
24672514

2468-
* `associated_types` - Allows type aliases in traits. Experimental.
2469-
2470-
* `no_std` - Allows the `#![no_std]` crate attribute, which disables the implicit
2471-
`extern crate std`. This typically requires use of the unstable APIs
2472-
behind the libstd "facade", such as libcore and libcollections. It
2473-
may also cause problems when using syntax extensions, including
2474-
`#[derive]`.
2515+
* `visible_private_types` - Allows public APIs to expose otherwise private
2516+
types, e.g. as the return type of a public function.
2517+
This capability may be removed in the future.
24752518

24762519
If a feature is promoted to a language feature, then all existing programs will
24772520
start to receive compilation warnings about #[feature] directives which enabled
@@ -2591,9 +2634,8 @@ of any reference that points to it.
25912634

25922635
When a [local variable](#memory-slots) is used as an
25932636
[rvalue](#lvalues,-rvalues-and-temporaries) the variable will either be moved
2594-
or copied, depending on its type. For types that contain [owning
2595-
pointers](#pointer-types) or values that implement the special trait `Drop`,
2596-
the variable is moved. All other types are copied.
2637+
or copied, depending on its type. All values whose type implements `Copy` are
2638+
copied, all others are moved.
25972639

25982640
### Literal expressions
25992641

@@ -2701,9 +2743,19 @@ items can bring new names into scopes and declared items are in scope for only
27012743
the block itself.
27022744

27032745
A block will execute each statement sequentially, and then execute the
2704-
expression (if given). If the final expression is omitted, the type and return
2705-
value of the block are `()`, but if it is provided, the type and return value
2706-
of the block are that of the expression itself.
2746+
expression (if given). If the block ends in a statement, its value is `()`:
2747+
2748+
```
2749+
let x: () = { println!("Hello."); };
2750+
```
2751+
2752+
If it ends in an expression, its value and type are that of the expression:
2753+
2754+
```
2755+
let x: i32 = { println!("Hello."); 5 };
2756+
2757+
assert_eq!(5, x);
2758+
```
27072759

27082760
### Method-call expressions
27092761

@@ -3502,9 +3554,6 @@ elements, respectively, in a parenthesized, comma-separated list.
35023554
Because tuple elements don't have a name, they can only be accessed by
35033555
pattern-matching.
35043556

3505-
The members of a tuple are laid out in memory contiguously, in order specified
3506-
by the tuple type.
3507-
35083557
An example of a tuple type and its use:
35093558

35103559
```

src/doc/trpl/arrays-vectors-and-slices.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ languages.
4949

5050
A *vector* is a dynamic or "growable" array, implemented as the standard
5151
library type [`Vec<T>`](../std/vec/) (we'll talk about what the `<T>` means
52-
later). Vectors are to arrays what `String` is to `&str`. You can create them
53-
with the `vec!` macro:
52+
later). Vectors always allocate their data on the heap. Vectors are to slices
53+
what `String` is to `&str`. You can create them with the `vec!` macro:
5454

5555
```{rust}
5656
let v = vec![1, 2, 3]; // v: Vec<i32>

0 commit comments

Comments
 (0)