Skip to content

Commit 42e0686

Browse files
committed
---
yaml --- r: 231884 b: refs/heads/auto c: 2cebf36 h: refs/heads/master v: v3
1 parent 27ccc5d commit 42e0686

File tree

162 files changed

+919
-8840
lines changed

Some content is hidden

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

162 files changed

+919
-8840
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
88
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
99
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1010
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
11-
refs/heads/auto: eaa5bf31b8b6cf05bb367f5046348aa098acfee9
11+
refs/heads/auto: 2cebf3666aababe58212f1102d077903042983fb
1212
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1313
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336
1414
refs/tags/0.2: 1754d02027f2924bed83b0160ee340c7f41d5ea1

branches/auto/COPYRIGHT

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,104 @@ The Rust Project includes packages written by third parties.
2222
The following third party packages are included, and carry
2323
their own copyright notices and license terms:
2424

25+
* Two header files that are part of the Valgrind
26+
package. These files are found at src/rt/valgrind/valgrind.h and
27+
src/rt/valgrind/memcheck.h, within this distribution. These files
28+
are redistributed under the following terms, as noted in
29+
them:
30+
31+
for src/rt/valgrind/valgrind.h:
32+
33+
This file is part of Valgrind, a dynamic binary
34+
instrumentation framework.
35+
36+
Copyright (C) 2000-2010 Julian Seward. All rights
37+
reserved.
38+
39+
Redistribution and use in source and binary forms, with
40+
or without modification, are permitted provided that the
41+
following conditions are met:
42+
43+
1. Redistributions of source code must retain the above
44+
copyright notice, this list of conditions and the
45+
following disclaimer.
46+
47+
2. The origin of this software must not be
48+
misrepresented; you must not claim that you wrote the
49+
original software. If you use this software in a
50+
product, an acknowledgment in the product
51+
documentation would be appreciated but is not
52+
required.
53+
54+
3. Altered source versions must be plainly marked as
55+
such, and must not be misrepresented as being the
56+
original software.
57+
58+
4. The name of the author may not be used to endorse or
59+
promote products derived from this software without
60+
specific prior written permission.
61+
62+
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND
63+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
64+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
65+
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
66+
NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
67+
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
68+
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
69+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
70+
USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
71+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
72+
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
73+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
74+
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
75+
OF SUCH DAMAGE.
76+
77+
for src/rt/valgrind/memcheck.h:
78+
79+
This file is part of MemCheck, a heavyweight Valgrind
80+
tool for detecting memory errors.
81+
82+
Copyright (C) 2000-2010 Julian Seward. All rights
83+
reserved.
84+
85+
Redistribution and use in source and binary forms, with
86+
or without modification, are permitted provided that the
87+
following conditions are met:
88+
89+
1. Redistributions of source code must retain the above
90+
copyright notice, this list of conditions and the
91+
following disclaimer.
92+
93+
2. The origin of this software must not be
94+
misrepresented; you must not claim that you wrote the
95+
original software. If you use this software in a
96+
product, an acknowledgment in the product
97+
documentation would be appreciated but is not
98+
required.
99+
100+
3. Altered source versions must be plainly marked as
101+
such, and must not be misrepresented as being the
102+
original software.
103+
104+
4. The name of the author may not be used to endorse or
105+
promote products derived from this software without
106+
specific prior written permission.
107+
108+
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND
109+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
110+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
111+
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
112+
NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
113+
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
114+
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
115+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
116+
USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
117+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
118+
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
119+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
120+
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
121+
OF SUCH DAMAGE.
122+
25123
* The src/rt/miniz.c file, carrying an implementation of
26124
RFC1950/RFC1951 DEFLATE, by Rich Geldreich
27125
<[email protected]>. All uses of this file are

branches/auto/RELEASES.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Version 1.2.0 (2015-08-07)
1+
Version 1.2.0 (August 2015)
22
===========================
33

44
* ~1200 changes, numerous bugfixes
@@ -156,7 +156,7 @@ Misc
156156
[ad]: https://github.com/rust-lang/rust/pull/27382
157157
[win]: https://github.com/rust-lang/rust/pull/25350
158158

159-
Version 1.1.0 (2015-06-25)
159+
Version 1.1.0 (June 2015)
160160
=========================
161161

162162
* ~850 changes, numerous bugfixes
@@ -267,7 +267,7 @@ Misc
267267
[`split_off`]: https://doc.rust-lang.org/nightly/collections/linked_list/struct.LinkedList.html#method.split_off
268268
[drop]: https://github.com/rust-lang/rust/pull/24935
269269

270-
Version 1.0.0 (2015-05-15)
270+
Version 1.0.0 (May 2015)
271271
========================
272272

273273
* ~1500 changes, numerous bugfixes

branches/auto/mk/crates.mk

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ TARGET_CRATES := libc std flate arena term \
5454
log graphviz core rbml alloc \
5555
rustc_unicode rustc_bitflags \
5656
alloc_system
57-
RUSTC_CRATES := rustc rustc_typeck rustc_mir rustc_borrowck rustc_resolve rustc_driver \
57+
RUSTC_CRATES := rustc rustc_typeck rustc_borrowck rustc_resolve rustc_driver \
5858
rustc_trans rustc_back rustc_llvm rustc_privacy rustc_lint \
5959
rustc_data_structures rustc_front rustc_platform_intrinsics
6060
HOST_CRATES := syntax $(RUSTC_CRATES) rustdoc fmt_macros
@@ -70,12 +70,11 @@ DEPS_std := core libc rand alloc collections rustc_unicode \
7070
DEPS_graphviz := std
7171
DEPS_syntax := std term serialize log fmt_macros arena libc rustc_bitflags
7272
DEPS_rustc_driver := arena flate getopts graphviz libc rustc rustc_back rustc_borrowck \
73-
rustc_typeck rustc_mir rustc_resolve log syntax serialize rustc_llvm \
73+
rustc_typeck rustc_resolve log syntax serialize rustc_llvm \
7474
rustc_trans rustc_privacy rustc_lint rustc_front
7575

7676
DEPS_rustc_trans := arena flate getopts graphviz libc rustc rustc_back \
7777
log syntax serialize rustc_llvm rustc_front rustc_platform_intrinsics
78-
DEPS_rustc_mir := rustc rustc_front syntax
7978
DEPS_rustc_typeck := rustc syntax rustc_front rustc_platform_intrinsics
8079
DEPS_rustc_borrowck := rustc rustc_front log graphviz syntax
8180
DEPS_rustc_resolve := rustc rustc_front log syntax

branches/auto/mk/main.mk

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -172,18 +172,6 @@ RUST_LIB_FLAGS_ST3 += -C prefer-dynamic
172172
# by not emitting them.
173173
RUSTFLAGS_STAGE0 += -Z no-landing-pads
174174

175-
# Enable MIR to "always build" for crates where this works. This is
176-
# just temporary while MIR is being actively built up -- it's just a
177-
# poor man's unit testing infrastructure. Anyway we only want this for
178-
# stage1/stage2.
179-
define ADD_MIR_FLAG
180-
RUSTFLAGS1_$(1) += -Z always-build-mir
181-
RUSTFLAGS2_$(1) += -Z always-build-mir
182-
endef
183-
$(foreach crate,$(TARGET_CRATES),$(eval $(call ADD_MIR_FLAG,$(crate))))
184-
$(foreach crate,$(RUSTC_CRATES),$(eval $(call ADD_MIR_FLAG,$(crate))))
185-
$(foreach crate,$(HOST_CRATES),$(eval $(call ADD_MIR_FLAG,$(crate))))
186-
187175
# platform-specific auto-configuration
188176
include $(CFG_SRC_DIR)mk/platform.mk
189177

branches/auto/mk/target.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$(4): \
9393
$$(LLVM_LIBDIR_RUSTFLAGS_$(2)) \
9494
$$(LLVM_STDCPP_RUSTFLAGS_$(2)) \
9595
$$(RUSTFLAGS_$(4)) \
96-
$$(RUSTFLAGS$(1)_$(4)) \
9796
$$(RUSTFLAGS$(1)_$(4)_T_$(2)) \
9897
--out-dir $$(@D) \
9998
-C extra-filename=-$$(CFG_FILENAME_EXTRA) \

branches/auto/src/doc/index.md

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,30 +20,13 @@ series of small examples.
2020

2121
[rbe]: http://rustbyexample.com/
2222

23-
# Language Reference
24-
25-
Rust does not have an exact specification yet, but an effort to describe as much of
26-
the language in as much detail as possible is in [the reference](reference.html).
27-
28-
# Standard Library Reference
23+
# The Standard Library
2924

3025
We have [API documentation for the entire standard
3126
library](std/index.html). There's a list of crates on the left with more
3227
specific sections, or you can use the search bar at the top to search for
3328
something if you know its name.
3429

35-
# Tools
36-
37-
[Cargo](https://crates.io) is the Rust's package manager providing access to libraries
38-
beyond the standard one, and its website contains lots of good documentation.
39-
40-
[`rustdoc`](book/documentation.html) is the Rust's documentation generator, a tool converting
41-
annotated source code into HTML docs.
42-
43-
A bunch of non-official tools are available, such as [Racer](https://github.com/phildawes/racer)
44-
(code completion engine), or [rustfmt](https://github.com/nrc/rustfmt) (source code formatter),
45-
or text editor plugins.
46-
4730
# Community & Getting Help
4831

4932
If you need help with something, or just want to talk about Rust with others,
@@ -71,10 +54,25 @@ There is an active [subreddit](https://reddit.com/r/rust) with lots of
7154
discussion and news about Rust.
7255

7356
There is also a [user forum](https://users.rust-lang.org), for all
74-
user-oriented discussion, and a [developer
57+
user-oriented discussion, and a [developer
7558
forum](https://internals.rust-lang.org/), where the development of Rust
7659
itself is discussed.
7760

61+
# Specification
62+
63+
Rust does not have an exact specification, but an effort to describe as much of
64+
the language in as much detail as possible is in [the reference](reference.html).
65+
66+
# Tools
67+
68+
Rust is still a young language, so there isn't a ton of tooling yet, but the
69+
tools we have are really nice.
70+
71+
[Cargo](https://crates.io) is Rust's package manager, and its website contains
72+
lots of good documentation.
73+
74+
[`rustdoc`](book/documentation.html) is used to generate documentation for Rust code.
75+
7876
# FAQs
7977

8078
There are questions that are asked quite often, so we've made FAQs for them:

branches/auto/src/doc/nomicon/vec-drain.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -129,16 +129,14 @@ impl<'a, T> Drop for Drain<'a, T> {
129129
130130
impl<T> Vec<T> {
131131
pub fn drain(&mut self) -> Drain<T> {
132-
unsafe {
133-
let iter = RawValIter::new(&self);
134-
135-
// this is a mem::forget safety thing. If Drain is forgotten, we just
136-
// leak the whole Vec's contents. Also we need to do this *eventually*
137-
// anyway, so why not do it now?
138-
self.len = 0;
132+
// this is a mem::forget safety thing. If Drain is forgotten, we just
133+
// leak the whole Vec's contents. Also we need to do this eventually
134+
// anyway, so why not do it now?
135+
self.len = 0;
139136
137+
unsafe {
140138
Drain {
141-
iter: iter,
139+
iter: RawValIter::new(&self),
142140
vec: PhantomData,
143141
}
144142
}

branches/auto/src/doc/nomicon/vec-final.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -155,16 +155,13 @@ impl<T> Vec<T> {
155155
}
156156

157157
pub fn drain(&mut self) -> Drain<T> {
158+
// this is a mem::forget safety thing. If this is forgotten, we just
159+
// leak the whole Vec's contents. Also we need to do this *eventually*
160+
// anyway, so why not do it now?
161+
self.len = 0;
158162
unsafe {
159-
let iter = RawValIter::new(&self);
160-
161-
// this is a mem::forget safety thing. If Drain is forgotten, we just
162-
// leak the whole Vec's contents. Also we need to do this *eventually*
163-
// anyway, so why not do it now?
164-
self.len = 0;
165-
166163
Drain {
167-
iter: iter,
164+
iter: RawValIter::new(&self),
168165
vec: PhantomData,
169166
}
170167
}

branches/auto/src/doc/trpl/advanced-linking.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ formal `#[link(...)]` attribute on `extern` blocks instead.
3434

3535
# Static linking
3636

37-
Static linking refers to the process of creating output that contains all
38-
required libraries and so doesn't need libraries installed on every system where
37+
Static linking refers to the process of creating output that contain all
38+
required libraries and so don't need libraries installed on every system where
3939
you want to use your compiled project. Pure-Rust dependencies are statically
4040
linked by default so you can use created binaries and libraries without
4141
installing Rust everywhere. By contrast, native libraries

branches/auto/src/doc/trpl/crates-and-modules.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,3 +532,51 @@ Goodbye in English: Goodbye.
532532
Hello in Japanese: こんにちは
533533
Goodbye in Japanese: さようなら
534534
```
535+
536+
## Complex imports
537+
538+
Rust offers several advanced options that can add compactness and
539+
convenience to your `extern crate` and `use` statements. Here is an example:
540+
541+
```rust,ignore
542+
extern crate phrases as sayings;
543+
544+
use sayings::japanese::greetings as ja_greetings;
545+
use sayings::japanese::farewells::*;
546+
use sayings::english::{self, greetings as en_greetings, farewells as en_farewells};
547+
548+
fn main() {
549+
println!("Hello in English; {}", en_greetings::hello());
550+
println!("And in Japanese: {}", ja_greetings::hello());
551+
println!("Goodbye in English: {}", english::farewells::goodbye());
552+
println!("Again: {}", en_farewells::goodbye());
553+
println!("And in Japanese: {}", goodbye());
554+
}
555+
```
556+
557+
What's going on here?
558+
559+
First, both `extern crate` and `use` allow renaming the thing that is being
560+
imported. So the crate is still called "phrases", but here we will refer
561+
to it as "sayings". Similarly, the first `use` statement pulls in the
562+
`japanese::farewells` module from the crate, but makes it available as
563+
`jp_farewells` as opposed to simply `farewells`. This can help to avoid
564+
ambiguity when importing similarly-named items from different places.
565+
566+
The second `use` statement uses a star glob to bring in _all_ symbols from the
567+
`sayings::japanese::farewells` module. As you can see we can later refer to
568+
the Japanese `goodbye` function with no module qualifiers. This kind of glob
569+
should be used sparingly.
570+
571+
The third `use` statement bears more explanation. It's using "brace expansion"
572+
globbing to compress three `use` statements into one (this sort of syntax
573+
may be familiar if you've written Linux shell scripts before). The
574+
uncompressed form of this statement would be:
575+
```rust,ignore
576+
use sayings::english;
577+
use sayings::english::greetings as en_greetings;
578+
use sayings::english::farewells as en_farewells;
579+
```
580+
As you can see, the curly brackets compress `use` statements for several items
581+
under the same path, and in this context `self` just refers back to that path.
582+
Note: The curly brackets cannot be nested or mixed with star globbing.

branches/auto/src/doc/trpl/macros.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ fn main() {
313313
}
314314
```
315315

316-
This works because Rust has a [hygienic macro system]. Each macro expansion
316+
This works because Rust has a [hygienic macro system][]. Each macro expansion
317317
happens in a distinct ‘syntax context’, and each variable is tagged with the
318318
syntax context where it was introduced. It’s as though the variable `state`
319319
inside `main` is painted a different "color" from the variable `state` inside

0 commit comments

Comments
 (0)