Skip to content

Commit 657a7bf

Browse files
committed
---
yaml --- r: 275447 b: refs/heads/auto c: eba8055 h: refs/heads/master i: 275445: b7ee1c4 275443: 6d2bf24 275439: 7122e50
1 parent 2f37dc8 commit 657a7bf

File tree

64 files changed

+660
-255
lines changed

Some content is hidden

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

64 files changed

+660
-255
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: f91649144e1e2e6b3664545cb7e117d839f9cd95
11+
refs/heads/auto: eba80558d7223900549786207fad4791e1f01d88
1212
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1313
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336
1414
refs/tags/0.2: 1754d02027f2924bed83b0160ee340c7f41d5ea1

branches/auto/RELEASES.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ Compatibility Notes
418418
numbers [no longer return platform-specific types][1.8r], but
419419
instead return widened integers. [RFC 1415].
420420
* [Modules sourced from the filesystem cannot appear within arbitrary
421-
blocks, but only within other modules][1.8m].
421+
blocks, but only within other modules][1.8mf].
422422
* [`--cfg` compiler flags are parsed strictly as identifiers][1.8c].
423423
* On Unix, [stack overflow triggers a runtime abort instead of a
424424
SIGSEGV][1.8so].
@@ -448,7 +448,7 @@ Compatibility Notes
448448
[1.8h]: https://github.com/rust-lang/rust/pull/31460
449449
[1.8l]: https://github.com/rust-lang/rust/pull/31668
450450
[1.8m]: https://github.com/rust-lang/rust/pull/31020
451-
[1.8m]: https://github.com/rust-lang/rust/pull/31534
451+
[1.8mf]: https://github.com/rust-lang/rust/pull/31534
452452
[1.8mp]: https://github.com/rust-lang/rust/pull/30894
453453
[1.8mr]: https://users.rust-lang.org/t/multirust-0-8-with-cross-std-installation/4901
454454
[1.8ms]: https://github.com/rust-lang/rust/pull/30448

branches/auto/mk/main.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
######################################################################
1414

1515
# The version number
16-
CFG_RELEASE_NUM=1.9.0
16+
CFG_RELEASE_NUM=1.10.0
1717

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

branches/auto/src/bootstrap/Cargo.lock

Lines changed: 8 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

branches/auto/src/bootstrap/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ path = "rustdoc.rs"
2121

2222
[dependencies]
2323
build_helper = { path = "../build_helper" }
24-
cmake = "0.1.10"
24+
cmake = "0.1.17"
2525
filetime = "0.1"
2626
num_cpus = "0.2"
2727
toml = "0.1"
@@ -31,3 +31,4 @@ winapi = "0.2"
3131
kernel32-sys = "0.2"
3232
gcc = "0.3.17"
3333
libc = "0.2"
34+
md5 = "0.1"

branches/auto/src/bootstrap/bootstrap.py

Lines changed: 40 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
import argparse
1212
import contextlib
13+
import hashlib
1314
import os
1415
import shutil
1516
import subprocess
@@ -18,13 +19,29 @@
1819

1920
def get(url, path, verbose=False):
2021
print("downloading " + url)
21-
# see http://serverfault.com/questions/301128/how-to-download
22-
if sys.platform == 'win32':
23-
run(["PowerShell.exe", "/nologo", "-Command",
24-
"(New-Object System.Net.WebClient).DownloadFile('" + url +
25-
"', '" + path + "')"], verbose=verbose)
26-
else:
27-
run(["curl", "-o", path, url], verbose=verbose)
22+
sha_url = url + ".sha256"
23+
sha_path = path + ".sha256"
24+
for _url, _path in ((url, path), (sha_url, sha_path)):
25+
# see http://serverfault.com/questions/301128/how-to-download
26+
if sys.platform == 'win32':
27+
run(["PowerShell.exe", "/nologo", "-Command",
28+
"(New-Object System.Net.WebClient)"
29+
".DownloadFile('{}', '{}')".format(_url, _path)],
30+
verbose=verbose)
31+
else:
32+
run(["curl", "-o", _path, _url], verbose=verbose)
33+
print("verifying " + path)
34+
with open(path, "rb") as f:
35+
found = hashlib.sha256(f.read()).hexdigest()
36+
with open(sha_path, "r") as f:
37+
expected, _ = f.readline().split()
38+
if found != expected:
39+
err = ("invalid checksum:\n"
40+
" found: {}\n"
41+
" expected: {}".format(found, expected))
42+
if verbose:
43+
raise RuntimeError(err)
44+
sys.exit(err)
2845

2946
def unpack(tarball, dst, verbose=False, match=None):
3047
print("extracting " + tarball)
@@ -57,9 +74,10 @@ def run(args, verbose=False):
5774
ret = subprocess.Popen(args)
5875
code = ret.wait()
5976
if code != 0:
60-
if not verbose:
61-
print("failed to run: " + ' '.join(args))
62-
raise RuntimeError("failed to run command")
77+
err = "failed to run: " + ' '.join(args)
78+
if verbose:
79+
raise RuntimeError(err)
80+
sys.exit(err)
6381

6482
class RustBuild:
6583
def download_rust_nightly(self):
@@ -210,7 +228,10 @@ def build_triple(self):
210228
if sys.platform == 'win32':
211229
return 'x86_64-pc-windows-msvc'
212230
else:
213-
raise
231+
err = "uname not found"
232+
if self.verbose:
233+
raise Exception(err)
234+
sys.exit(err)
214235

215236
# Darwin's `uname -s` lies and always returns i386. We have to use
216237
# sysctl instead.
@@ -253,7 +274,10 @@ def build_triple(self):
253274
cputype = 'x86_64'
254275
ostype = 'pc-windows-gnu'
255276
else:
256-
raise ValueError("unknown OS type: " + ostype)
277+
err = "unknown OS type: " + ostype
278+
if self.verbose:
279+
raise ValueError(err)
280+
sys.exit(err)
257281

258282
if cputype in {'i386', 'i486', 'i686', 'i786', 'x86'}:
259283
cputype = 'i686'
@@ -269,7 +293,10 @@ def build_triple(self):
269293
elif cputype in {'amd64', 'x86_64', 'x86-64', 'x64'}:
270294
cputype = 'x86_64'
271295
else:
272-
raise ValueError("unknown cpu type: " + cputype)
296+
err = "unknown cpu type: " + cputype
297+
if self.verbose:
298+
raise ValueError(err)
299+
sys.exit(err)
273300

274301
return cputype + '-' + ostype
275302

branches/auto/src/bootstrap/build/channel.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
use std::env;
1112
use std::fs::{self, File};
1213
use std::io::prelude::*;
13-
use std::path::Path;
1414
use std::process::Command;
1515

1616
use build_helper::output;
17+
use md5;
1718

1819
use build::Build;
19-
use build::util::mtime;
2020

2121
pub fn collect(build: &mut Build) {
2222
let mut main_mk = String::new();
@@ -80,7 +80,8 @@ pub fn collect(build: &mut Build) {
8080
build.short_ver_hash = Some(short_ver_hash);
8181
}
8282

83-
build.bootstrap_key = mtime(Path::new("config.toml")).seconds()
84-
.to_string();
83+
let key = md5::compute(build.release.as_bytes());
84+
build.bootstrap_key = format!("{:02x}{:02x}{:02x}{:02x}",
85+
key[0], key[1], key[2], key[3]);
86+
env::set_var("RUSTC_BOOTSTRAP_KEY", &build.bootstrap_key);
8587
}
86-

branches/auto/src/bootstrap/build/check.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
use std::fs;
12+
1113
use build::{Build, Compiler};
1214

1315
pub fn linkcheck(build: &Build, stage: u32, host: &str) {
@@ -29,9 +31,16 @@ pub fn cargotest(build: &Build, stage: u32, host: &str) {
2931
let sep = if cfg!(windows) { ";" } else {":" };
3032
let ref newpath = format!("{}{}{}", path.display(), sep, old_path);
3133

34+
// Note that this is a short, cryptic, and not scoped directory name. This
35+
// is currently to minimize the length of path on Windows where we otherwise
36+
// quickly run into path name limit constraints.
37+
let out_dir = build.out.join("ct");
38+
t!(fs::create_dir_all(&out_dir));
39+
3240
build.run(build.tool_cmd(compiler, "cargotest")
33-
.env("PATH", newpath)
34-
.arg(&build.cargo));
41+
.env("PATH", newpath)
42+
.arg(&build.cargo)
43+
.arg(&out_dir));
3544
}
3645

3746
pub fn tidy(build: &Build, stage: u32, host: &str) {

branches/auto/src/bootstrap/build/config.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ use toml::{Parser, Decoder, Value};
3131
#[derive(Default)]
3232
pub struct Config {
3333
pub ccache: bool,
34+
pub ninja: bool,
3435
pub verbose: bool,
3536
pub submodules: bool,
3637
pub compiler_docs: bool,
@@ -107,6 +108,7 @@ struct Build {
107108
#[derive(RustcDecodable, Default)]
108109
struct Llvm {
109110
ccache: Option<bool>,
111+
ninja: Option<bool>,
110112
assertions: Option<bool>,
111113
optimize: Option<bool>,
112114
version_check: Option<bool>,
@@ -200,9 +202,9 @@ impl Config {
200202

201203
if let Some(ref llvm) = toml.llvm {
202204
set(&mut config.ccache, llvm.ccache);
205+
set(&mut config.ninja, llvm.ninja);
203206
set(&mut config.llvm_assertions, llvm.assertions);
204207
set(&mut config.llvm_optimize, llvm.optimize);
205-
set(&mut config.llvm_optimize, llvm.optimize);
206208
set(&mut config.llvm_version_check, llvm.version_check);
207209
set(&mut config.llvm_static_stdcpp, llvm.static_libstdcpp);
208210
}

branches/auto/src/bootstrap/build/native.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ pub fn llvm(build: &Build, target: &str) {
4343

4444
// http://llvm.org/docs/CMake.html
4545
let mut cfg = cmake::Config::new(build.src.join("src/llvm"));
46+
if build.config.ninja {
47+
cfg.generator("Ninja");
48+
}
4649
cfg.target(target)
4750
.host(&build.config.build)
4851
.out_dir(&dst)

branches/auto/src/bootstrap/build/sanity.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ pub fn check(build: &mut Build) {
4848
}
4949
}
5050
need_cmd("cmake".as_ref());
51+
if build.config.ninja {
52+
need_cmd("ninja".as_ref())
53+
}
5154
break
5255
}
5356

branches/auto/src/bootstrap/build/step.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,8 @@ impl<'a> Step<'a> {
318318
vec![self.tool_linkchecker(stage), self.doc(stage)]
319319
}
320320
Source::CheckCargoTest { stage } => {
321-
vec![self.tool_cargotest(stage)]
321+
vec![self.tool_cargotest(stage),
322+
self.librustc(self.compiler(stage))]
322323
}
323324
Source::CheckTidy { stage } => {
324325
vec![self.tool_tidy(stage)]
@@ -333,7 +334,7 @@ impl<'a> Step<'a> {
333334
vec![self.librustc(self.compiler(stage))]
334335
}
335336
Source::ToolCargoTest { stage } => {
336-
vec![self.librustc(self.compiler(stage))]
337+
vec![self.libstd(self.compiler(stage))]
337338
}
338339

339340
Source::DistDocs { stage } => vec![self.doc(stage)],

branches/auto/src/bootstrap/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ extern crate libc;
2020
extern crate num_cpus;
2121
extern crate rustc_serialize;
2222
extern crate toml;
23+
extern crate md5;
2324

2425
use std::env;
2526

branches/auto/src/doc/book/getting-started.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,8 +575,12 @@ look something like this:
575575
name = "hello_world"
576576
version = "0.1.0"
577577
authors = ["Your Name <you@example.com>"]
578+
579+
[dependencies]
578580
```
579581

582+
Do not worry about the `[dependencies]` line, we will come back to it later.
583+
580584
Cargo has populated *Cargo.toml* with reasonable defaults based on the arguments
581585
you gave it and your `git` global configuration. You may notice that Cargo has
582586
also initialized the `hello_world` directory as a `git` repository.

branches/auto/src/doc/book/guessing-game.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -988,8 +988,7 @@ fn main() {
988988
989989
# Complete!
990990
991-
At this point, you have successfully built the Guessing Game! Congratulations!
991+
This project showed you a lot: `let`, `match`, methods, associated
992+
functions, using external crates, and more.
992993
993-
This first project showed you a lot: `let`, `match`, methods, associated
994-
functions, using external crates, and more. Our next project will show off
995-
even more.
994+
At this point, you have successfully built the Guessing Game! Congratulations!

branches/auto/src/libcollections/lib.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
test(no_crate_inject, attr(allow(unused_variables), deny(warnings))))]
2828

2929
#![cfg_attr(test, allow(deprecated))] // rand
30+
#![cfg_attr(not(test), feature(slice_binary_search_by_key))] // impl [T]
3031
#![cfg_attr(not(stage0), deny(warnings))]
3132

3233
#![feature(alloc)]
@@ -131,3 +132,10 @@ pub enum Bound<T> {
131132
/// An infinite endpoint. Indicates that there is no bound in this direction.
132133
Unbounded,
133134
}
135+
136+
/// An intermediate trait for specialization of `Extend`.
137+
#[doc(hidden)]
138+
trait SpecExtend<I: IntoIterator> {
139+
/// Extends `self` with the contents of the given iterator.
140+
fn spec_extend(&mut self, iter: I);
141+
}

branches/auto/src/libcollections/linked_list.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ use core::mem;
3030
use core::ops::{BoxPlace, InPlace, Place, Placer};
3131
use core::ptr::{self, Shared};
3232

33+
use super::SpecExtend;
34+
3335
/// A doubly-linked list.
3436
#[stable(feature = "rust1", since = "1.0.0")]
3537
pub struct LinkedList<T> {
@@ -969,12 +971,24 @@ impl<'a, T> IntoIterator for &'a mut LinkedList<T> {
969971
#[stable(feature = "rust1", since = "1.0.0")]
970972
impl<A> Extend<A> for LinkedList<A> {
971973
fn extend<T: IntoIterator<Item = A>>(&mut self, iter: T) {
974+
<Self as SpecExtend<T>>::spec_extend(self, iter);
975+
}
976+
}
977+
978+
impl<I: IntoIterator> SpecExtend<I> for LinkedList<I::Item> {
979+
default fn spec_extend(&mut self, iter: I) {
972980
for elt in iter {
973981
self.push_back(elt);
974982
}
975983
}
976984
}
977985

986+
impl<T> SpecExtend<LinkedList<T>> for LinkedList<T> {
987+
fn spec_extend(&mut self, ref mut other: LinkedList<T>) {
988+
self.append(other);
989+
}
990+
}
991+
978992
#[stable(feature = "extend_ref", since = "1.2.0")]
979993
impl<'a, T: 'a + Copy> Extend<&'a T> for LinkedList<T> {
980994
fn extend<I: IntoIterator<Item = &'a T>>(&mut self, iter: I) {

0 commit comments

Comments
 (0)