Skip to content

Commit 3ae5a9f

Browse files
committed
---
yaml --- r: 184115 b: refs/heads/beta c: 9774b7e h: refs/heads/master i: 184113: 0513d38 184111: 2365e6d v: v3
1 parent 182cb77 commit 3ae5a9f

File tree

173 files changed

+1145
-537
lines changed

Some content is hidden

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

173 files changed

+1145
-537
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ refs/heads/automation-fail: 1bf06495443584539b958873e04cc2f864ab10e4
3131
refs/heads/issue-18208-method-dispatch-3-quick-reject: 2009f85b9f99dedcec4404418eda9ddba90258a2
3232
refs/heads/batch: b7fd822592a4fb577552d93010c4a4e14f314346
3333
refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
34-
refs/heads/beta: f83e23ad7c464c242c2d7ace7212d323980b2bca
34+
refs/heads/beta: 9774b7e64b7ff8323b4f8160cc38eb793f447217
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3636
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
3737
refs/heads/tmp: c65fb1a81e5dc58cf171cc47f65de9e6e2119247

branches/beta/README.md

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
# The Rust Programming Language
22

33
This is a compiler for Rust, including standard libraries, tools and
4-
documentation.
4+
documentation. Rust is a systems programming language that is fast,
5+
memory safe and multithreaded, but does not employ a garbage collector
6+
or otherwise impose significant runtime overhead.
57

68
## Quick Start
79

8-
Read ["Installing Rust"][install] from [The Book][trpl].
10+
Read ["Installing Rust"] from [The Book].
911

10-
[install]: http://doc.rust-lang.org/book/installing-rust.html
11-
[trpl]: http://doc.rust-lang.org/book/index.html
12+
["Installing Rust"]: http://doc.rust-lang.org/book/installing-rust.html
13+
[The Book]: http://doc.rust-lang.org/book/index.html
1214

1315
## Building from Source
1416

@@ -19,22 +21,14 @@ Read ["Installing Rust"][install] from [The Book][trpl].
1921
* `curl`
2022
* `git`
2123

22-
2. Download and build Rust:
23-
24-
You can either download a [tarball] or build directly from the [repo].
25-
26-
To build from the [tarball] do:
27-
28-
$ curl -O https://static.rust-lang.org/dist/rustc-nightly-src.tar.gz
29-
$ tar -xzf rustc-nightly-src.tar.gz
30-
$ cd rustc-nightly
31-
32-
Or to build from the [repo] do:
24+
2. Clone the [source] with `git`:
3325

3426
$ git clone https://github.com/rust-lang/rust.git
3527
$ cd rust
3628

37-
Now that you have Rust's source code, you can configure and build it:
29+
[source]: https://github.com/rust-lang/rust
30+
31+
3. Build and install:
3832

3933
$ ./configure
4034
$ make && make install
@@ -46,7 +40,10 @@ Read ["Installing Rust"][install] from [The Book][trpl].
4640
4741
When complete, `make install` will place several programs into
4842
`/usr/local/bin`: `rustc`, the Rust compiler, and `rustdoc`, the
49-
API-documentation tool.
43+
API-documentation tool. This install does not include [Cargo],
44+
Rust's package manager, which you may also want to build.
45+
46+
[Cargo]: https://github.com/rust-lang/cargo
5047

5148
### Building on Windows
5249

@@ -72,9 +69,6 @@ $ pacman -S base-devel
7269
$ ./configure
7370
$ make && make install
7471

75-
[repo]: https://github.com/rust-lang/rust
76-
[tarball]: https://static.rust-lang.org/dist/rustc-nightly-src.tar.gz
77-
7872
## Notes
7973

8074
Since the Rust compiler is written in Rust, it must be built by a
@@ -94,9 +88,9 @@ supported build environments that are most likely to work.
9488
Rust currently needs about 1.5 GiB of RAM to build without swapping; if it hits
9589
swap, it will take a very long time to build.
9690

97-
There is a lot more documentation in the [wiki].
91+
There is more advice about hacking on Rust in [CONTRIBUTING.md].
9892

99-
[wiki]: https://github.com/rust-lang/rust/wiki
93+
[CONTRIBUTING.md]: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md
10094

10195
## Getting help
10296

@@ -114,6 +108,14 @@ The Rust community congregates in a few places:
114108

115109
To contribute to Rust, please see [CONTRIBUTING.md](CONTRIBUTING.md).
116110

111+
Rust has an [IRC] culture and most real-time collaboration happens in a
112+
variety of channels on Mozilla's IRC network, irc.mozilla.org. The
113+
most popular channel is [#rust], a venue for general discussion about
114+
Rust, and a good place to ask for help,
115+
116+
[IRC]: https://en.wikipedia.org/wiki/Internet_Relay_Chat
117+
[#rust]: irc://irc.mozilla.org/rust
118+
117119
## License
118120

119121
Rust is primarily distributed under the terms of both the MIT license

branches/beta/configure

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,6 +1056,7 @@ do
10561056
make_dir $h/test/run-pass-fulldeps
10571057
make_dir $h/test/run-fail
10581058
make_dir $h/test/compile-fail
1059+
make_dir $h/test/parse-fail
10591060
make_dir $h/test/compile-fail-fulldeps
10601061
make_dir $h/test/bench
10611062
make_dir $h/test/perf

branches/beta/mk/tests.mk

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,12 +174,12 @@ check-notidy: cleantmptestlogs cleantestlibs all check-stage2
174174
check-lite: cleantestlibs cleantmptestlogs \
175175
$(foreach crate,$(TEST_TARGET_CRATES),check-stage2-$(crate)) \
176176
check-stage2-rpass check-stage2-rpass-valgrind \
177-
check-stage2-rfail check-stage2-cfail check-stage2-rmake
177+
check-stage2-rfail check-stage2-cfail check-stage2-pfail check-stage2-rmake
178178
$(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
179179

180180
# Only check the 'reference' tests: rpass/cfail/rfail/rmake.
181181
check-ref: cleantestlibs cleantmptestlogs check-stage2-rpass check-stage2-rpass-valgrind \
182-
check-stage2-rfail check-stage2-cfail check-stage2-rmake
182+
check-stage2-rfail check-stage2-cfail check-stage2-pfail check-stage2-rmake
183183
$(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
184184

185185
# Only check the docs.
@@ -291,6 +291,7 @@ check-stage$(1)-T-$(2)-H-$(3)-exec: \
291291
check-stage$(1)-T-$(2)-H-$(3)-rpass-exec \
292292
check-stage$(1)-T-$(2)-H-$(3)-rfail-exec \
293293
check-stage$(1)-T-$(2)-H-$(3)-cfail-exec \
294+
check-stage$(1)-T-$(2)-H-$(3)-pfail-exec \
294295
check-stage$(1)-T-$(2)-H-$(3)-rpass-valgrind-exec \
295296
check-stage$(1)-T-$(2)-H-$(3)-rpass-full-exec \
296297
check-stage$(1)-T-$(2)-H-$(3)-cfail-full-exec \
@@ -470,7 +471,8 @@ RPASS_VALGRIND_TESTS := $(RPASS_VALGRIND_RS)
470471
RPASS_FULL_TESTS := $(RPASS_FULL_RS)
471472
CFAIL_FULL_TESTS := $(CFAIL_FULL_RS)
472473
RFAIL_TESTS := $(RFAIL_RS)
473-
CFAIL_TESTS := $(CFAIL_RS) $(PFAIL_RS)
474+
CFAIL_TESTS := $(CFAIL_RS)
475+
PFAIL_TESTS := $(PFAIL_RS)
474476
BENCH_TESTS := $(BENCH_RS)
475477
PERF_TESTS := $(PERF_RS)
476478
PRETTY_TESTS := $(PRETTY_RS)
@@ -508,6 +510,11 @@ CTEST_BUILD_BASE_cfail = compile-fail
508510
CTEST_MODE_cfail = compile-fail
509511
CTEST_RUNTOOL_cfail = $(CTEST_RUNTOOL)
510512

513+
CTEST_SRC_BASE_pfail = parse-fail
514+
CTEST_BUILD_BASE_pfail = parse-fail
515+
CTEST_MODE_pfail = parse-fail
516+
CTEST_RUNTOOL_pfail = $(CTEST_RUNTOOL)
517+
511518
CTEST_SRC_BASE_bench = bench
512519
CTEST_BUILD_BASE_bench = bench
513520
CTEST_MODE_bench = run-pass
@@ -630,6 +637,7 @@ CTEST_DEPS_rpass-full_$(1)-T-$(2)-H-$(3) = $$(RPASS_FULL_TESTS) $$(CSREQ$(1)_T_$
630637
CTEST_DEPS_cfail-full_$(1)-T-$(2)-H-$(3) = $$(CFAIL_FULL_TESTS) $$(CSREQ$(1)_T_$(3)_H_$(3)) $$(SREQ$(1)_T_$(2)_H_$(3))
631638
CTEST_DEPS_rfail_$(1)-T-$(2)-H-$(3) = $$(RFAIL_TESTS)
632639
CTEST_DEPS_cfail_$(1)-T-$(2)-H-$(3) = $$(CFAIL_TESTS)
640+
CTEST_DEPS_pfail_$(1)-T-$(2)-H-$(3) = $$(PFAIL_TESTS)
633641
CTEST_DEPS_bench_$(1)-T-$(2)-H-$(3) = $$(BENCH_TESTS)
634642
CTEST_DEPS_perf_$(1)-T-$(2)-H-$(3) = $$(PERF_TESTS)
635643
CTEST_DEPS_debuginfo-gdb_$(1)-T-$(2)-H-$(3) = $$(DEBUGINFO_GDB_TESTS)
@@ -698,7 +706,7 @@ endif
698706

699707
endef
700708

701-
CTEST_NAMES = rpass rpass-valgrind rpass-full cfail-full rfail cfail bench perf debuginfo-gdb debuginfo-lldb codegen
709+
CTEST_NAMES = rpass rpass-valgrind rpass-full cfail-full rfail cfail pfail bench perf debuginfo-gdb debuginfo-lldb codegen
702710

703711
$(foreach host,$(CFG_HOST), \
704712
$(eval $(foreach target,$(CFG_TARGET), \
@@ -857,6 +865,7 @@ TEST_GROUPS = \
857865
cfail-full \
858866
rfail \
859867
cfail \
868+
pfail \
860869
bench \
861870
perf \
862871
rmake \

branches/beta/src/compiletest/common.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ use std::str::FromStr;
1515
#[derive(Clone, Copy, PartialEq, Debug)]
1616
pub enum Mode {
1717
CompileFail,
18+
ParseFail,
1819
RunFail,
1920
RunPass,
2021
RunPassValgrind,
@@ -29,6 +30,7 @@ impl FromStr for Mode {
2930
fn from_str(s: &str) -> Result<Mode, ()> {
3031
match s {
3132
"compile-fail" => Ok(CompileFail),
33+
"parse-fail" => Ok(ParseFail),
3234
"run-fail" => Ok(RunFail),
3335
"run-pass" => Ok(RunPass),
3436
"run-pass-valgrind" => Ok(RunPassValgrind),
@@ -45,6 +47,7 @@ impl fmt::Display for Mode {
4547
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
4648
fmt::Display::fmt(match *self {
4749
CompileFail => "compile-fail",
50+
ParseFail => "parse-fail",
4851
RunFail => "run-fail",
4952
RunPass => "run-pass",
5053
RunPassValgrind => "run-pass-valgrind",

branches/beta/src/compiletest/compiletest.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#![feature(test)]
2222
#![feature(unicode)]
2323
#![feature(env)]
24+
#![feature(core)]
2425

2526
#![deny(warnings)]
2627

@@ -72,7 +73,7 @@ pub fn parse_config(args: Vec<String> ) -> Config {
7273
reqopt("", "aux-base", "directory to find auxiliary test files", "PATH"),
7374
reqopt("", "stage-id", "the target-stage identifier", "stageN-TARGET"),
7475
reqopt("", "mode", "which sort of compile tests to run",
75-
"(compile-fail|run-fail|run-pass|run-pass-valgrind|pretty|debug-info)"),
76+
"(compile-fail|parse-fail|run-fail|run-pass|run-pass-valgrind|pretty|debug-info)"),
7677
optflag("", "ignored", "run tests marked as ignored"),
7778
optopt("", "runtool", "supervisor program to run tests under \
7879
(eg. emulator, valgrind)", "PROGRAM"),

branches/beta/src/compiletest/runtest.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use self::TargetLocation::*;
1212

1313
use common::Config;
14-
use common::{CompileFail, Pretty, RunFail, RunPass, RunPassValgrind, DebugInfoGdb};
14+
use common::{CompileFail, ParseFail, Pretty, RunFail, RunPass, RunPassValgrind, DebugInfoGdb};
1515
use common::{Codegen, DebugInfoLldb};
1616
use errors;
1717
use header::TestProps;
@@ -66,6 +66,7 @@ pub fn run_metrics(config: Config, testfile: String, mm: &mut MetricMap) {
6666
debug!("loaded props");
6767
match config.mode {
6868
CompileFail => run_cfail_test(&config, &props, &testfile),
69+
ParseFail => run_cfail_test(&config, &props, &testfile),
6970
RunFail => run_rfail_test(&config, &props, &testfile),
7071
RunPass => run_rpass_test(&config, &props, &testfile),
7172
RunPassValgrind => run_valgrind_test(&config, &props, &testfile),
@@ -88,7 +89,7 @@ fn run_cfail_test(config: &Config, props: &TestProps, testfile: &Path) {
8889
let proc_res = compile_test(config, props, testfile);
8990

9091
if proc_res.status.success() {
91-
fatal_proc_rec("compile-fail test compiled successfully!",
92+
fatal_proc_rec(&format!("{} test compiled successfully!", config.mode)[],
9293
&proc_res);
9394
}
9495

@@ -1133,7 +1134,7 @@ fn compile_test_(config: &Config, props: &TestProps,
11331134
// FIXME (#9639): This needs to handle non-utf8 paths
11341135
let mut link_args = vec!("-L".to_string(),
11351136
aux_dir.as_str().unwrap().to_string());
1136-
link_args.extend(extra_args.iter().map(|s| s.clone()));
1137+
link_args.extend(extra_args.iter().cloned());
11371138
let args = make_compile_args(config,
11381139
props,
11391140
link_args,

branches/beta/src/libcollections/bit.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2307,7 +2307,7 @@ mod tests {
23072307
#[test]
23082308
fn test_from_bools() {
23092309
let bools = vec![true, false, true, true];
2310-
let bitv: Bitv = bools.iter().map(|n| *n).collect();
2310+
let bitv: Bitv = bools.iter().cloned().collect();
23112311
assert_eq!(format!("{:?}", bitv), "1011");
23122312
}
23132313

@@ -2320,12 +2320,12 @@ mod tests {
23202320
#[test]
23212321
fn test_bitv_iterator() {
23222322
let bools = vec![true, false, true, true];
2323-
let bitv: Bitv = bools.iter().map(|n| *n).collect();
2323+
let bitv: Bitv = bools.iter().cloned().collect();
23242324

23252325
assert_eq!(bitv.iter().collect::<Vec<bool>>(), bools);
23262326

23272327
let long: Vec<_> = (0i32..10000).map(|i| i % 2 == 0).collect();
2328-
let bitv: Bitv = long.iter().map(|n| *n).collect();
2328+
let bitv: Bitv = long.iter().cloned().collect();
23292329
assert_eq!(bitv.iter().collect::<Vec<bool>>(), long)
23302330
}
23312331

branches/beta/src/libcollections/dlist.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -909,7 +909,7 @@ impl<A: Ord> Ord for DList<A> {
909909
#[stable(feature = "rust1", since = "1.0.0")]
910910
impl<A: Clone> Clone for DList<A> {
911911
fn clone(&self) -> DList<A> {
912-
self.iter().map(|x| x.clone()).collect()
912+
self.iter().cloned().collect()
913913
}
914914
}
915915

@@ -1038,7 +1038,7 @@ mod tests {
10381038

10391039
#[cfg(test)]
10401040
fn list_from<T: Clone>(v: &[T]) -> DList<T> {
1041-
v.iter().map(|x| (*x).clone()).collect()
1041+
v.iter().cloned().collect()
10421042
}
10431043

10441044
#[test]

branches/beta/src/libcollections/vec.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ use core::cmp::{Ordering};
5656
use core::default::Default;
5757
use core::fmt;
5858
use core::hash::{self, Hash};
59+
use core::intrinsics::assume;
5960
use core::iter::{repeat, FromIterator, IntoIterator};
6061
use core::marker::{self, ContravariantLifetime, InvariantType};
6162
use core::mem;
@@ -1596,8 +1597,12 @@ impl<T> AsSlice<T> for Vec<T> {
15961597
#[stable(feature = "rust1", since = "1.0.0")]
15971598
fn as_slice(&self) -> &[T] {
15981599
unsafe {
1600+
let p = *self.ptr;
1601+
if cfg!(not(stage0)) { // NOTE remove cfg after next snapshot
1602+
assume(p != 0 as *mut T);
1603+
}
15991604
mem::transmute(RawSlice {
1600-
data: *self.ptr,
1605+
data: p,
16011606
len: self.len
16021607
})
16031608
}

branches/beta/src/libcore/iter.rs

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ pub trait IteratorExt: Iterator + Sized {
332332
///
333333
/// ```
334334
/// let xs = [100, 200, 300];
335-
/// let mut it = xs.iter().map(|x| *x).peekable();
335+
/// let mut it = xs.iter().cloned().peekable();
336336
/// assert_eq!(*it.peek().unwrap(), 100);
337337
/// assert_eq!(it.next().unwrap(), 100);
338338
/// assert_eq!(it.next().unwrap(), 200);
@@ -522,7 +522,7 @@ pub trait IteratorExt: Iterator + Sized {
522522
///
523523
/// let a = [1, 4, 2, 3, 8, 9, 6];
524524
/// let sum = a.iter()
525-
/// .map(|&x| x)
525+
/// .cloned()
526526
/// .inspect(|&x| println!("filtering {}", x))
527527
/// .filter(|&x| x % 2 == 0)
528528
/// .inspect(|&x| println!("{} made it through", x))
@@ -561,7 +561,7 @@ pub trait IteratorExt: Iterator + Sized {
561561
///
562562
/// ```
563563
/// let a = [1, 2, 3, 4, 5];
564-
/// let b: Vec<_> = a.iter().map(|&x| x).collect();
564+
/// let b: Vec<_> = a.iter().cloned().collect();
565565
/// assert_eq!(a, b);
566566
/// ```
567567
#[inline]
@@ -937,7 +937,7 @@ pub trait IteratorExt: Iterator + Sized {
937937
///
938938
/// ```
939939
/// let a = [(1, 2), (3, 4)];
940-
/// let (left, right): (Vec<_>, Vec<_>) = a.iter().map(|&x| x).unzip();
940+
/// let (left, right): (Vec<_>, Vec<_>) = a.iter().cloned().unzip();
941941
/// assert_eq!([1, 3], left);
942942
/// assert_eq!([2, 4], right);
943943
/// ```
@@ -1142,7 +1142,7 @@ pub trait AdditiveIterator<A> {
11421142
/// use std::iter::AdditiveIterator;
11431143
///
11441144
/// let a = [1i32, 2, 3, 4, 5];
1145-
/// let mut it = a.iter().map(|&x| x);
1145+
/// let mut it = a.iter().cloned();
11461146
/// assert!(it.sum() == 15);
11471147
/// ```
11481148
fn sum(self) -> A;
@@ -1305,6 +1305,23 @@ impl<T, D, I> ExactSizeIterator for Cloned<I> where
13051305
I: ExactSizeIterator<Item=D>,
13061306
{}
13071307

1308+
#[unstable(feature = "core", reason = "trait is experimental")]
1309+
impl<T, D, I> RandomAccessIterator for Cloned<I> where
1310+
T: Clone,
1311+
D: Deref<Target=T>,
1312+
I: RandomAccessIterator<Item=D>
1313+
{
1314+
#[inline]
1315+
fn indexable(&self) -> usize {
1316+
self.it.indexable()
1317+
}
1318+
1319+
#[inline]
1320+
fn idx(&mut self, index: usize) -> Option<T> {
1321+
self.it.idx(index).cloned()
1322+
}
1323+
}
1324+
13081325
/// An iterator that repeats endlessly
13091326
#[derive(Clone)]
13101327
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]

0 commit comments

Comments
 (0)