Skip to content

Commit ba07bca

Browse files
committed
---
yaml --- r: 44439 b: refs/heads/master c: 6efa354 h: refs/heads/master i: 44437: 250a9f3 44435: 1d9497e 44431: 3c7bb3e v: v3
1 parent 0bbb7d3 commit ba07bca

File tree

419 files changed

+3625
-2802
lines changed

Some content is hidden

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

419 files changed

+3625
-2802
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 5336bf6addc7091ed303a06246b43b99dc0c5cd1
2+
refs/heads/master: 6efa3543a8b38f0dcbe89e7bf6d14f571bad46ac
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a6d9689399d091c3265f00434a69c551a61c28dc
55
refs/heads/try: ef355f6332f83371e4acf04fc4eb940ab41d78d3

trunk/AUTHORS.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Benjamin Peterson <[email protected]>
2929
Bilal Husain <[email protected]>
3030
Bill Fallon <[email protected]>
3131
Brendan Eich <[email protected]>
32+
Brendan Zabarauskas <[email protected]>
3233
Brian Anderson <[email protected]>
3334
Brian J. Burg <[email protected]>
3435
Brian Leibig <[email protected]>
@@ -80,6 +81,7 @@ Jeff Muizelaar <[email protected]>
8081
Jeff Olson <[email protected]>
8182
Jeffrey Yasskin <[email protected]>
8283
Jens Nockert <[email protected]>
84+
Jesse Jones <[email protected]>
8385
Jesse Ruderman <[email protected]>
8486
Jim Blandy <[email protected]>
8587
@@ -105,6 +107,7 @@ Mahmut Bulut <[email protected]>
105107
Margaret Meyerhofer <[email protected]>
106108
Marijn Haverbeke <[email protected]>
107109
Mark Lacey <[email protected]>
110+
Mark Vian <[email protected]>
108111
Martin DeMello <[email protected]>
109112
Marvin Löbel <[email protected]>
110113
Matt Brubeck <[email protected]>
@@ -149,6 +152,7 @@ Tim Taubert <[email protected]>
149152
150153
Tomoki Aonuma <[email protected]>
151154
Tony Young <[email protected]>
155+
152156
Tycho Sci <[email protected]>
153157
Tyler Bindon <[email protected]>
154158
Viktor Dahl <[email protected]>

trunk/doc/rust.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -202,13 +202,7 @@ grammar as double-quoted strings. Other tokens have exact rules given.
202202

203203
### Keywords
204204

205-
The keywords in [crate files](#crate-files) are the following strings:
206-
207-
~~~~~~~~ {.keyword}
208-
mod priv pub use
209-
~~~~~~~~
210-
211-
The keywords in [source files](#source-files) are the following strings:
205+
The keywords are the following strings:
212206

213207
~~~~~~~~ {.keyword}
214208
as assert

trunk/src/compiletest/compiletest.rc

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ mod errors;
3333
use std::getopts;
3434
use std::test;
3535

36-
use core::result;
36+
use core::{result, either};
3737
use result::{Ok, Err};
3838

3939
use common::config;
@@ -70,7 +70,7 @@ pub fn parse_config(args: ~[~str]) -> config {
7070
let matches =
7171
&match getopts::getopts(args_, opts) {
7272
Ok(m) => m,
73-
Err(f) => die!(getopts::fail_str(f))
73+
Err(f) => fail!(getopts::fail_str(f))
7474
};
7575

7676
fn opt_path(m: &getopts::Matches, nm: ~str) -> Path {
@@ -133,7 +133,7 @@ pub fn str_mode(s: ~str) -> mode {
133133
~"run-pass" => mode_run_pass,
134134
~"pretty" => mode_pretty,
135135
~"debug-info" => mode_debug_info,
136-
_ => die!(~"invalid mode")
136+
_ => fail!(~"invalid mode")
137137
}
138138
}
139139

@@ -151,14 +151,18 @@ pub fn run_tests(config: config) {
151151
let opts = test_opts(config);
152152
let tests = make_tests(config);
153153
let res = test::run_tests_console(&opts, tests);
154-
if !res { die!(~"Some tests failed"); }
154+
if !res { fail!(~"Some tests failed"); }
155155
}
156156

157157
pub fn test_opts(config: config) -> test::TestOpts {
158158
test::TestOpts {
159159
filter: config.filter,
160160
run_ignored: config.run_ignored,
161-
logfile: config.logfile.map(|s| s.to_str()),
161+
logfile: copy config.logfile,
162+
run_tests: true,
163+
run_benchmarks: false,
164+
save_results: option::None,
165+
compare_results: option::None
162166
}
163167
}
164168

@@ -210,13 +214,15 @@ pub fn make_test(config: config, testfile: &Path) -> test::TestDescAndFn {
210214
}
211215
}
212216

213-
pub fn make_test_name(config: config, testfile: &Path) -> ~str {
214-
fmt!("[%s] %s", mode_str(config.mode), testfile.to_str())
217+
pub fn make_test_name(config: config, testfile: &Path) -> test::TestName {
218+
test::DynTestName(fmt!("[%s] %s",
219+
mode_str(config.mode),
220+
testfile.to_str()))
215221
}
216222

217223
pub fn make_test_closure(config: config, testfile: &Path) -> test::TestFn {
218224
let testfile = testfile.to_str();
219-
fn~() { runtest::run(config, testfile) }
225+
test::DynTestFn(fn~() { runtest::run(config, testfile) })
220226
}
221227

222228
// Local Variables:

trunk/src/compiletest/header.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ fn parse_exec_env(line: ~str) -> Option<(~str, ~str)> {
145145
match strs.len() {
146146
1u => (strs[0], ~""),
147147
2u => (strs[0], strs[1]),
148-
n => die!(fmt!("Expected 1 or 2 strings, not %u", n))
148+
n => fail!(fmt!("Expected 1 or 2 strings, not %u", n))
149149
}
150150
}
151151
}

trunk/src/compiletest/procsrv.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ pub fn run(lib_path: ~str,
7171
os::close(pipe_in.out);
7272
os::close(pipe_out.in);
7373
os::close(pipe_err.in);
74-
die!();
74+
fail!();
7575
}
7676

7777

@@ -99,7 +99,7 @@ pub fn run(lib_path: ~str,
9999
(2, s) => {
100100
errs = s;
101101
}
102-
_ => { die!() }
102+
_ => { fail!() }
103103
};
104104
count -= 1;
105105
};

trunk/src/compiletest/runtest.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ actual:\n\
202202
\n",
203203
expected, actual);
204204
io::stdout().write_str(msg);
205-
die!();
205+
fail!();
206206
}
207207
}
208208

@@ -322,8 +322,8 @@ fn check_expected_errors(expected_errors: ~[errors::ExpectedError],
322322
ProcRes: ProcRes) {
323323

324324
// true if we found the error in question
325-
let found_flags = vec::cast_to_mut(vec::from_elem(
326-
vec::len(expected_errors), false));
325+
let mut found_flags = vec::from_elem(
326+
vec::len(expected_errors), false);
327327

328328
if ProcRes.status == 0 {
329329
fatal(~"process did not return an error status");
@@ -518,7 +518,7 @@ fn compose_and_run_compiler(
518518
fn ensure_dir(path: &Path) {
519519
if os::path_is_dir(path) { return; }
520520
if !os::make_dir(path, 0x1c0i32) {
521-
die!(fmt!("can't make dir %s", path.to_str()));
521+
fail!(fmt!("can't make dir %s", path.to_str()));
522522
}
523523
}
524524

@@ -668,7 +668,7 @@ fn maybe_dump_to_stdout(config: config, out: ~str, err: ~str) {
668668
669669
fn error(err: ~str) { io::stdout().write_line(fmt!("\nerror: %s", err)); }
670670
671-
fn fatal(err: ~str) -> ! { error(err); die!(); }
671+
fn fatal(err: ~str) -> ! { error(err); fail!(); }
672672
673673
fn fatal_ProcRes(err: ~str, ProcRes: ProcRes) -> ! {
674674
let msg =
@@ -686,5 +686,5 @@ stderr:\n\
686686
\n",
687687
err, ProcRes.cmdline, ProcRes.stdout, ProcRes.stderr);
688688
io::stdout().write_str(msg);
689-
die!();
689+
fail!();
690690
}

trunk/src/etc/licenseck.py

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

11-
license0 = """\
12-
// Copyright 2012-2013 The Rust Project Developers. See the
11+
license0 = """// Copyright 2012-2013 The Rust Project Developers. See the
1312
// COPYRIGHT file at the top-level directory of this distribution and at
1413
// http://rust-lang.org/COPYRIGHT.
1514
//
@@ -20,8 +19,7 @@
2019
// except according to those terms.
2120
"""
2221

23-
license1 = """\
24-
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
22+
license1 = """// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
2523
// file at the top-level directory of this distribution and at
2624
// http://rust-lang.org/COPYRIGHT.
2725
//
@@ -32,8 +30,7 @@
3230
// except according to those terms.
3331
"""
3432

35-
license2 = """\
36-
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
33+
license2 = """// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
3734
// file at the top-level directory of this distribution and at
3835
// http://rust-lang.org/COPYRIGHT.
3936
//
@@ -44,8 +41,7 @@
4441
// except according to those terms.
4542
"""
4643

47-
license3 = """\
48-
# Copyright 2013 The Rust Project Developers. See the COPYRIGHT
44+
license3 = """# Copyright 2013 The Rust Project Developers. See the COPYRIGHT
4945
# file at the top-level directory of this distribution and at
5046
# http://rust-lang.org/COPYRIGHT.
5147
#
@@ -56,19 +52,7 @@
5652
# except according to those terms.
5753
"""
5854

59-
license4 = """\
60-
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
61-
// file at the top-level directory of this distribution and at
62-
// http://rust-lang.org/COPYRIGHT.
63-
//
64-
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
65-
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
66-
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
67-
// option. This file may not be copied, modified, or distributed
68-
// except according to those terms.
69-
"""
70-
71-
licenses = [license0, license1, license2, license3, license4]
55+
licenses = [license0, license1, license2, license3]
7256

7357
exceptions = [
7458
"rt/rust_android_dummy.cpp", # BSD, chromium

trunk/src/libcargo/cargo.rc

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ pub fn load_link(mis: ~[@ast::meta_item]) -> (Option<~str>,
295295
_ => { }
296296
}
297297
}
298-
_ => die!(~"load_link: meta items must be name-values")
298+
_ => fail!(~"load_link: meta items must be name-values")
299299
}
300300
}
301301
(name, vers, uuid)
@@ -332,7 +332,7 @@ pub fn load_crate(filename: &Path) -> Option<Crate> {
332332
}
333333
}
334334
_ => {
335-
die!(~"crate attributes may not contain " +
335+
fail!(~"crate attributes may not contain " +
336336
~"meta_words");
337337
}
338338
}
@@ -435,7 +435,7 @@ pub fn rest(s: ~str, start: uint) -> ~str {
435435
pub fn need_dir(s: &Path) {
436436
if os::path_is_dir(s) { return; }
437437
if !os::make_dir(s, 493_i32 /* oct: 755 */) {
438-
die!(fmt!("can't make_dir %s", s.to_str()));
438+
fail!(fmt!("can't make_dir %s", s.to_str()));
439439
}
440440
}
441441

@@ -453,14 +453,14 @@ pub fn valid_pkg_name(s: &str) -> bool {
453453

454454
pub fn parse_source(name: ~str, j: &json::Json) -> @Source {
455455
if !valid_pkg_name(name) {
456-
die!(fmt!("'%s' is an invalid source name", name));
456+
fail!(fmt!("'%s' is an invalid source name", name));
457457
}
458458

459459
match *j {
460460
json::Object(ref j) => {
461461
let mut url = match j.find(&~"url") {
462462
Some(&json::String(u)) => copy u,
463-
_ => die!(~"needed 'url' field in source")
463+
_ => fail!(~"needed 'url' field in source")
464464
};
465465
let method = match j.find(&~"method") {
466466
Some(&json::String(u)) => copy u,
@@ -485,7 +485,7 @@ pub fn parse_source(name: ~str, j: &json::Json) -> @Source {
485485
mut keyfp: keyfp,
486486
packages: DVec() };
487487
}
488-
_ => die!(~"needed dict value in source")
488+
_ => fail!(~"needed dict value in source")
489489
};
490490
}
491491

@@ -500,8 +500,8 @@ pub fn try_parse_sources(filename: &Path,
500500
debug!("source: %s", *k);
501501
}
502502
}
503-
Ok(_) => die!(~"malformed sources.json"),
504-
Err(e) => die!(fmt!("%s:%s", filename.to_str(), e.to_str()))
503+
Ok(_) => fail!(~"malformed sources.json"),
504+
Err(e) => fail!(fmt!("%s:%s", filename.to_str(), e.to_str()))
505505
}
506506
}
507507

@@ -662,7 +662,7 @@ pub fn build_cargo_options(argv: ~[~str]) -> Options {
662662
let matches = &match getopts::getopts(argv, opts()) {
663663
result::Ok(m) => m,
664664
result::Err(f) => {
665-
die!(fmt!("%s", getopts::fail_str(f)));
665+
fail!(fmt!("%s", getopts::fail_str(f)));
666666
}
667667
};
668668

@@ -675,10 +675,10 @@ pub fn build_cargo_options(argv: ~[~str]) -> Options {
675675
let is_install = len > 1u && matches.free[1] == ~"install";
676676
let is_uninstall = len > 1u && matches.free[1] == ~"uninstall";
677677

678-
if G && g { die!(~"-G and -g both provided"); }
678+
if G && g { fail!(~"-G and -g both provided"); }
679679

680680
if !is_install && !is_uninstall && (g || G) {
681-
die!(~"-g and -G are only valid for `install` and `uninstall|rm`");
681+
fail!(~"-g and -G are only valid for `install` and `uninstall|rm`");
682682
}
683683

684684
let mode =
@@ -845,7 +845,7 @@ pub fn install_source(c: &mut Cargo, path: &Path) {
845845
}
846846

847847
if vec::is_empty(cratefiles) {
848-
die!(~"this doesn't look like a rust package (no .rc files)");
848+
fail!(~"this doesn't look like a rust package (no .rc files)");
849849
}
850850

851851
for cratefiles.each |cf| {
@@ -889,7 +889,7 @@ pub fn install_curl(c: &mut Cargo, wd: &Path, url: ~str) {
889889
let p = run::program_output(~"curl", ~[~"-f", ~"-s", ~"-o",
890890
tarpath.to_str(), url]);
891891
if p.status != 0 {
892-
die!(fmt!("fetch of %s failed: %s", url, p.err));
892+
fail!(fmt!("fetch of %s failed: %s", url, p.err));
893893
}
894894
run::run_program(~"tar", ~[~"-x", ~"--strip-components=1",
895895
~"-C", wd.to_str(),
@@ -1123,7 +1123,7 @@ pub fn install_query(c: &mut Cargo, wd: &Path, target: ~str) {
11231123
pub fn get_temp_workdir(c: &Cargo) -> Path {
11241124
match tempfile::mkdtemp(&c.workdir, "cargo") {
11251125
Some(wd) => wd,
1126-
None => die!(fmt!("needed temp dir: %s",
1126+
None => fail!(fmt!("needed temp dir: %s",
11271127
c.workdir.to_str()))
11281128
}
11291129
}
@@ -1138,7 +1138,7 @@ pub fn cmd_install(c: &mut Cargo) {
11381138
wd.to_str()]);
11391139

11401140
if status != 0 {
1141-
die!(fmt!("could not copy directory: %s", cwd.to_str()));
1141+
fail!(fmt!("could not copy directory: %s", cwd.to_str()));
11421142
}
11431143

11441144
install_source(c, &wd);

trunk/src/libcargo/pgp.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ pub fn init(root: &Path) {
8787
p.input().write_str(signing_key());
8888
let s = p.finish();
8989
if s != 0 {
90-
die!(~"pgp init failed");
90+
fail!(~"pgp init failed");
9191
}
9292
}
9393
}
@@ -98,7 +98,7 @@ pub fn add(root: &Path, key: &Path) {
9898
run::program_output(~"gpg", ~[~"--homedir", path.to_str(),
9999
~"--import", key.to_str()]);
100100
if p.status != 0 {
101-
die!(~"pgp add failed: " + p.out);
101+
fail!(~"pgp add failed: " + p.out);
102102
}
103103
}
104104

0 commit comments

Comments
 (0)