Skip to content

Commit 2d76728

Browse files
committed
---
yaml --- r: 195227 b: refs/heads/tmp c: cbef22e h: refs/heads/master i: 195225: 955c52a 195223: 58444fa v: v3
1 parent 549c456 commit 2d76728

File tree

2,711 files changed

+10928
-18615
lines changed

Some content is hidden

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

2,711 files changed

+10928
-18615
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
3434
refs/heads/beta: d8be84eb4499e21bd98a3500c8760540996df23b
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3636
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
37-
refs/heads/tmp: 7e3fd148b3d9579d341398eb70356eaa8c2e4b56
37+
refs/heads/tmp: cbef22e242fd43f76b895c8f1fc1cadf1c2a26cf
3838
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3939
refs/tags/homu-tmp: 53a183f0274316596bf9405944d4f0468d8c93e4
4040
refs/heads/gate: 97c84447b65164731087ea82685580cc81424412

branches/tmp/man/rustc.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ full debug info with variable and type information.
242242
\fBopt\-level\fR=\fIVAL\fR
243243
Optimize with possible levels 0\[en]3
244244

245-
.SH ENVIRONMENT
245+
.SH ENVIRONMENT VARIABLES
246246

247247
Some of these affect the output of the compiler, while others affect programs
248248
which link to the standard library.

branches/tmp/mk/tests.mk

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -569,11 +569,6 @@ ifeq ($(CFG_OSTYPE),apple-darwin)
569569
CTEST_DISABLE_debuginfo-gdb = "gdb on darwin needs root"
570570
endif
571571

572-
ifeq ($(findstring android, $(CFG_TARGET)), android)
573-
CTEST_DISABLE_debuginfo-gdb =
574-
CTEST_DISABLE_debuginfo-lldb = "lldb tests are disabled on android"
575-
endif
576-
577572
# CTEST_DISABLE_NONSELFHOST_$(TEST_GROUP), if set, will cause that
578573
# test group to be disabled *unless* the target is able to build a
579574
# compiler (i.e. when the target triple is in the set of of host

branches/tmp/src/compiletest/compiletest.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212

1313
#![feature(box_syntax)]
1414
#![feature(collections)]
15+
#![feature(int_uint)]
1516
#![feature(old_io)]
17+
#![feature(old_path)]
1618
#![feature(rustc_private)]
1719
#![feature(unboxed_closures)]
1820
#![feature(std_misc)]
1921
#![feature(test)]
2022
#![feature(path_ext)]
21-
#![feature(convert)]
22-
#![feature(str_char)]
2323

2424
#![deny(warnings)]
2525

@@ -115,7 +115,7 @@ pub fn parse_config(args: Vec<String> ) -> Config {
115115

116116
fn opt_path(m: &getopts::Matches, nm: &str) -> PathBuf {
117117
match m.opt_str(nm) {
118-
Some(s) => PathBuf::from(&s),
118+
Some(s) => PathBuf::new(&s),
119119
None => panic!("no option (=path) found for {}", nm),
120120
}
121121
}
@@ -130,18 +130,18 @@ pub fn parse_config(args: Vec<String> ) -> Config {
130130
compile_lib_path: matches.opt_str("compile-lib-path").unwrap(),
131131
run_lib_path: matches.opt_str("run-lib-path").unwrap(),
132132
rustc_path: opt_path(matches, "rustc-path"),
133-
clang_path: matches.opt_str("clang-path").map(|s| PathBuf::from(&s)),
133+
clang_path: matches.opt_str("clang-path").map(|s| PathBuf::new(&s)),
134134
valgrind_path: matches.opt_str("valgrind-path"),
135135
force_valgrind: matches.opt_present("force-valgrind"),
136-
llvm_bin_path: matches.opt_str("llvm-bin-path").map(|s| PathBuf::from(&s)),
136+
llvm_bin_path: matches.opt_str("llvm-bin-path").map(|s| PathBuf::new(&s)),
137137
src_base: opt_path(matches, "src-base"),
138138
build_base: opt_path(matches, "build-base"),
139139
aux_base: opt_path(matches, "aux-base"),
140140
stage_id: matches.opt_str("stage-id").unwrap(),
141141
mode: matches.opt_str("mode").unwrap().parse().ok().expect("invalid mode"),
142142
run_ignored: matches.opt_present("ignored"),
143143
filter: filter,
144-
logfile: matches.opt_str("logfile").map(|s| PathBuf::from(&s)),
144+
logfile: matches.opt_str("logfile").map(|s| PathBuf::new(&s)),
145145
runtool: matches.opt_str("runtool"),
146146
host_rustcflags: matches.opt_str("host-rustcflags"),
147147
target_rustcflags: matches.opt_str("target-rustcflags"),

branches/tmp/src/compiletest/errors.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ use std::io::prelude::*;
1515
use std::path::Path;
1616

1717
pub struct ExpectedError {
18-
pub line: usize,
18+
pub line: uint,
1919
pub kind: String,
2020
pub msg: String,
2121
}
2222

2323
#[derive(PartialEq, Debug)]
24-
enum WhichLine { ThisLine, FollowPrevious(usize), AdjustBackward(usize) }
24+
enum WhichLine { ThisLine, FollowPrevious(uint), AdjustBackward(uint) }
2525

2626
/// Looks for either "//~| KIND MESSAGE" or "//~^^... KIND MESSAGE"
2727
/// The former is a "follow" that inherits its target from the preceding line;
@@ -58,8 +58,8 @@ pub fn load_errors(testfile: &Path) -> Vec<ExpectedError> {
5858
}).collect()
5959
}
6060

61-
fn parse_expected(last_nonfollow_error: Option<usize>,
62-
line_num: usize,
61+
fn parse_expected(last_nonfollow_error: Option<uint>,
62+
line_num: uint,
6363
line: &str) -> Option<(WhichLine, ExpectedError)> {
6464
let start = match line.find("//~") { Some(i) => i, None => return None };
6565
let (follow, adjusts) = if line.char_at(start + 3) == '|' {

branches/tmp/src/compiletest/header.rs

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ pub struct TestProps {
4040
pub check_stdout: bool,
4141
// Don't force a --crate-type=dylib flag on the command line
4242
pub no_prefer_dynamic: bool,
43-
// Run --pretty expanded when running pretty printing tests
44-
pub pretty_expanded: bool,
43+
// Don't run --pretty expanded when running pretty printing tests
44+
pub no_pretty_expanded: bool,
4545
// Which pretty mode are we testing with, default to 'normal'
4646
pub pretty_mode: String,
4747
// Only compare pretty output and don't try compiling
@@ -62,7 +62,7 @@ pub fn load_props(testfile: &Path) -> TestProps {
6262
let mut force_host = false;
6363
let mut check_stdout = false;
6464
let mut no_prefer_dynamic = false;
65-
let mut pretty_expanded = false;
65+
let mut no_pretty_expanded = false;
6666
let mut pretty_mode = None;
6767
let mut pretty_compare_only = false;
6868
let mut forbid_output = Vec::new();
@@ -96,8 +96,8 @@ pub fn load_props(testfile: &Path) -> TestProps {
9696
no_prefer_dynamic = parse_no_prefer_dynamic(ln);
9797
}
9898

99-
if !pretty_expanded {
100-
pretty_expanded = parse_pretty_expanded(ln);
99+
if !no_pretty_expanded {
100+
no_pretty_expanded = parse_no_pretty_expanded(ln);
101101
}
102102

103103
if pretty_mode.is_none() {
@@ -152,7 +152,7 @@ pub fn load_props(testfile: &Path) -> TestProps {
152152
force_host: force_host,
153153
check_stdout: check_stdout,
154154
no_prefer_dynamic: no_prefer_dynamic,
155-
pretty_expanded: pretty_expanded,
155+
no_pretty_expanded: no_pretty_expanded,
156156
pretty_mode: pretty_mode.unwrap_or("normal".to_string()),
157157
pretty_compare_only: pretty_compare_only,
158158
forbid_output: forbid_output,
@@ -295,8 +295,8 @@ fn parse_no_prefer_dynamic(line: &str) -> bool {
295295
parse_name_directive(line, "no-prefer-dynamic")
296296
}
297297

298-
fn parse_pretty_expanded(line: &str) -> bool {
299-
parse_name_directive(line, "pretty-expanded")
298+
fn parse_no_pretty_expanded(line: &str) -> bool {
299+
parse_name_directive(line, "no-pretty-expanded")
300300
}
301301

302302
fn parse_pretty_mode(line: &str) -> Option<String> {
@@ -328,10 +328,10 @@ fn parse_exec_env(line: &str) -> Option<(String, String)> {
328328

329329
fn parse_pp_exact(line: &str, testfile: &Path) -> Option<PathBuf> {
330330
match parse_name_value_directive(line, "pp-exact") {
331-
Some(s) => Some(PathBuf::from(&s)),
331+
Some(s) => Some(PathBuf::new(&s)),
332332
None => {
333333
if parse_name_directive(line, "pp-exact") {
334-
testfile.file_name().map(|s| PathBuf::from(s))
334+
testfile.file_name().map(|s| PathBuf::new(s))
335335
} else {
336336
None
337337
}
@@ -340,8 +340,7 @@ fn parse_pp_exact(line: &str, testfile: &Path) -> Option<PathBuf> {
340340
}
341341

342342
fn parse_name_directive(line: &str, directive: &str) -> bool {
343-
// This 'no-' rule is a quick hack to allow pretty-expanded and no-pretty-expanded to coexist
344-
line.contains(directive) && !line.contains(&("no-".to_string() + directive))
343+
line.contains(directive)
345344
}
346345

347346
pub fn parse_name_value_directive(line: &str, directive: &str)
@@ -357,7 +356,7 @@ pub fn parse_name_value_directive(line: &str, directive: &str)
357356
}
358357
}
359358

360-
pub fn gdb_version_to_int(version_string: &str) -> isize {
359+
pub fn gdb_version_to_int(version_string: &str) -> int {
361360
let error_string = format!(
362361
"Encountered GDB version string with unexpected format: {}",
363362
version_string);
@@ -369,17 +368,17 @@ pub fn gdb_version_to_int(version_string: &str) -> isize {
369368
panic!("{}", error_string);
370369
}
371370

372-
let major: isize = components[0].parse().ok().expect(&error_string);
373-
let minor: isize = components[1].parse().ok().expect(&error_string);
371+
let major: int = components[0].parse().ok().expect(&error_string);
372+
let minor: int = components[1].parse().ok().expect(&error_string);
374373

375374
return major * 1000 + minor;
376375
}
377376

378-
pub fn lldb_version_to_int(version_string: &str) -> isize {
377+
pub fn lldb_version_to_int(version_string: &str) -> int {
379378
let error_string = format!(
380379
"Encountered LLDB version string with unexpected format: {}",
381380
version_string);
382381
let error_string = error_string;
383-
let major: isize = version_string.parse().ok().expect(&error_string);
382+
let major: int = version_string.parse().ok().expect(&error_string);
384383
return major;
385384
}

branches/tmp/src/compiletest/procsrv.rs

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

11+
#![allow(deprecated)] // for old path, for dynamic_lib
12+
1113
use std::dynamic_lib::DynamicLibrary;
1214
use std::io::prelude::*;
13-
use std::path::PathBuf;
15+
use std::old_path::Path;
1416
use std::process::{ExitStatus, Command, Child, Output, Stdio};
1517

1618
fn add_target_env(cmd: &mut Command, lib_path: &str, aux_path: Option<&str>) {
1719
// Need to be sure to put both the lib_path and the aux path in the dylib
1820
// search path for the child.
1921
let mut path = DynamicLibrary::search_path();
2022
match aux_path {
21-
Some(p) => path.insert(0, PathBuf::from(p)),
23+
Some(p) => path.insert(0, Path::new(p)),
2224
None => {}
2325
}
24-
path.insert(0, PathBuf::from(lib_path));
26+
path.insert(0, Path::new(lib_path));
2527

2628
// Add the new dylib search path var
2729
let var = DynamicLibrary::envvar();
2830
let newpath = DynamicLibrary::create_path(&path);
29-
let newpath = newpath.to_str().unwrap().to_string();
31+
let newpath = String::from_utf8(newpath).unwrap();
3032
cmd.env(var, &newpath);
3133
}
3234

branches/tmp/src/compiletest/runtest.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ fn run_pretty_test(config: &Config, props: &TestProps, testfile: &Path) {
245245
if !proc_res.status.success() {
246246
fatal_proc_rec("pretty-printed source does not typecheck", &proc_res);
247247
}
248-
if !props.pretty_expanded { return }
248+
if props.no_pretty_expanded { return }
249249

250250
// additionally, run `--pretty expanded` and try to build it.
251251
let proc_res = print_source(config, props, testfile, srcs[round].clone(), "expanded");
@@ -758,7 +758,7 @@ fn run_debuginfo_lldb_test(config: &Config, props: &TestProps, testfile: &Path)
758758
struct DebuggerCommands {
759759
commands: Vec<String>,
760760
check_lines: Vec<String>,
761-
breakpoint_lines: Vec<usize>,
761+
breakpoint_lines: Vec<uint>,
762762
}
763763

764764
fn parse_debugger_commands(file_path: &Path, debugger_prefix: &str)
@@ -1036,7 +1036,7 @@ fn is_compiler_error_or_warning(line: &str) -> bool {
10361036
scan_string(line, "warning", &mut i));
10371037
}
10381038

1039-
fn scan_until_char(haystack: &str, needle: char, idx: &mut usize) -> bool {
1039+
fn scan_until_char(haystack: &str, needle: char, idx: &mut uint) -> bool {
10401040
if *idx >= haystack.len() {
10411041
return false;
10421042
}
@@ -1048,7 +1048,7 @@ fn scan_until_char(haystack: &str, needle: char, idx: &mut usize) -> bool {
10481048
return true;
10491049
}
10501050

1051-
fn scan_char(haystack: &str, needle: char, idx: &mut usize) -> bool {
1051+
fn scan_char(haystack: &str, needle: char, idx: &mut uint) -> bool {
10521052
if *idx >= haystack.len() {
10531053
return false;
10541054
}
@@ -1060,7 +1060,7 @@ fn scan_char(haystack: &str, needle: char, idx: &mut usize) -> bool {
10601060
return true;
10611061
}
10621062

1063-
fn scan_integer(haystack: &str, idx: &mut usize) -> bool {
1063+
fn scan_integer(haystack: &str, idx: &mut uint) -> bool {
10641064
let mut i = *idx;
10651065
while i < haystack.len() {
10661066
let ch = haystack.char_at(i);
@@ -1076,7 +1076,7 @@ fn scan_integer(haystack: &str, idx: &mut usize) -> bool {
10761076
return true;
10771077
}
10781078

1079-
fn scan_string(haystack: &str, needle: &str, idx: &mut usize) -> bool {
1079+
fn scan_string(haystack: &str, needle: &str, idx: &mut uint) -> bool {
10801080
let mut haystack_i = *idx;
10811081
let mut needle_i = 0;
10821082
while needle_i < needle.len() {
@@ -1440,7 +1440,7 @@ fn aux_output_dir_name(config: &Config, testfile: &Path) -> PathBuf {
14401440
}
14411441

14421442
fn output_testname(testfile: &Path) -> PathBuf {
1443-
PathBuf::from(testfile.file_stem().unwrap())
1443+
PathBuf::new(testfile.file_stem().unwrap())
14441444
}
14451445

14461446
fn output_base_name(config: &Config, testfile: &Path) -> PathBuf {
@@ -1725,7 +1725,7 @@ fn disassemble_extract(config: &Config, _props: &TestProps,
17251725
}
17261726

17271727

1728-
fn count_extracted_lines(p: &Path) -> usize {
1728+
fn count_extracted_lines(p: &Path) -> uint {
17291729
let mut x = Vec::new();
17301730
File::open(&p.with_extension("ll")).unwrap().read_to_end(&mut x).unwrap();
17311731
let x = str::from_utf8(&x).unwrap();

branches/tmp/src/compiletest/util.rs

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,34 +13,33 @@ use common::Config;
1313

1414
/// Conversion table from triple OS name to Rust SYSNAME
1515
const OS_TABLE: &'static [(&'static str, &'static str)] = &[
16-
("android", "android"),
17-
("bitrig", "bitrig"),
18-
("darwin", "macos"),
19-
("dragonfly", "dragonfly"),
20-
("freebsd", "freebsd"),
21-
("ios", "ios"),
22-
("linux", "linux"),
2316
("mingw32", "windows"),
24-
("openbsd", "openbsd"),
2517
("win32", "windows"),
2618
("windows", "windows"),
19+
("darwin", "macos"),
20+
("android", "android"),
21+
("linux", "linux"),
22+
("freebsd", "freebsd"),
23+
("dragonfly", "dragonfly"),
24+
("bitrig", "bitrig"),
25+
("openbsd", "openbsd"),
2726
];
2827

2928
const ARCH_TABLE: &'static [(&'static str, &'static str)] = &[
30-
("aarch64", "aarch64"),
31-
("amd64", "x86_64"),
32-
("arm", "arm"),
33-
("arm64", "aarch64"),
34-
("hexagon", "hexagon"),
3529
("i386", "x86"),
3630
("i686", "x86"),
31+
("amd64", "x86_64"),
32+
("x86_64", "x86_64"),
33+
("sparc", "sparc"),
34+
("powerpc", "powerpc"),
35+
("arm64", "aarch64"),
36+
("arm", "arm"),
37+
("aarch64", "aarch64"),
3738
("mips", "mips"),
39+
("xcore", "xcore"),
3840
("msp430", "msp430"),
39-
("powerpc", "powerpc"),
41+
("hexagon", "hexagon"),
4042
("s390x", "systemz"),
41-
("sparc", "sparc"),
42-
("x86_64", "x86_64"),
43-
("xcore", "xcore"),
4443
];
4544

4645
pub fn get_os(triple: &str) -> &'static str {

branches/tmp/src/doc/intro.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -446,16 +446,16 @@ It gives us this error:
446446
error: aborting due to previous error
447447
```
448448
449-
This is a little confusing because there are two closures here: the one passed
450-
to `map`, and the one passed to `thread::scoped`. In this case, the closure for
451-
`thread::scoped` is attempting to reference `numbers`, a `Vec<i32>`. This
452-
closure is a `FnOnce` closure, as that’s what `thread::scoped` takes as an
453-
argument. `FnOnce` closures take ownership of their environment. That’s fine,
454-
but there’s one detail: because of `map`, we’re going to make three of these
455-
closures. And since all three try to take ownership of `numbers`, that would be
456-
a problem. That’s what it means by ‘cannot move out of captured outer
457-
variable’: our `thread::scoped` closure wants to take ownership, and it can’t,
458-
because the closure for `map` won’t let it.
449+
It mentions that "captured outer variable in an `FnMut` closure".
450+
Because we declared the closure as a moving closure, and it referred
451+
to `numbers`, the closure will try to take ownership of the
452+
vector. But the closure itself is created in a loop, and hence we will
453+
actually create three closures, one for every iteration of the
454+
loop. This means that all three of those closures would try to own
455+
`numbers`, which is impossible -- `numbers` must have just one
456+
owner. Rust detects this and gives us the error: we claim that
457+
`numbers` has ownership, but our code tries to make three owners. This
458+
may cause a safety problem, so Rust disallows it.
459459
460460
What to do here? Rust has two types that helps us: `Arc<T>` and `Mutex<T>`.
461461
*Arc* stands for "atomically reference counted". In other words, an Arc will

0 commit comments

Comments
 (0)