Skip to content

Commit

Permalink
Auto merge of #21872 - alexcrichton:rollup, r=alexcrichton
Browse files Browse the repository at this point in the history
  • Loading branch information
bors committed Feb 3, 2015
2 parents eaf4c5c + 9ece22e commit 7858cb4
Show file tree
Hide file tree
Showing 447 changed files with 5,748 additions and 3,194 deletions.
20 changes: 4 additions & 16 deletions COPYRIGHT
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ The following third party packages are included, and carry
their own copyright notices and license terms:

* Two header files that are part of the Valgrind
package. These files are found at src/rt/vg/valgrind.h and
src/rt/vg/memcheck.h, within this distribution. These files
package. These files are found at src/rt/valgrind/valgrind.h and
src/rt/valgrind/memcheck.h, within this distribution. These files
are redistributed under the following terms, as noted in
them:

for src/rt/vg/valgrind.h:
for src/rt/valgrind/valgrind.h:

This file is part of Valgrind, a dynamic binary
instrumentation framework.
Expand Down Expand Up @@ -74,7 +74,7 @@ their own copyright notices and license terms:
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
OF SUCH DAMAGE.

for src/rt/vg/memcheck.h:
for src/rt/valgrind/memcheck.h:

This file is part of MemCheck, a heavyweight Valgrind
tool for detecting memory errors.
Expand Down Expand Up @@ -120,18 +120,6 @@ their own copyright notices and license terms:
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
OF SUCH DAMAGE.

* The auxiliary file src/etc/pkg/modpath.iss contains a
library routine compiled, by Inno Setup, into the Windows
installer binary. This file is licensed under the LGPL,
version 3, but, in our legal interpretation, this does not
affect the aggregate "collected work" license of the Rust
distribution (MIT/ASL2) nor any other components of it. We
believe that the terms governing distribution of the
binary Windows installer built from modpath.iss are
therefore LGPL, but not the terms governing distribution
of any of the files installed by such an installer (such
as the Rust compiler or runtime libraries themselves).

* The src/rt/miniz.c file, carrying an implementation of
RFC1950/RFC1951 DEFLATE, by Rich Geldreich
<richgel99@gmail.com>. All uses of this file are
Expand Down
4 changes: 4 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,10 @@ case $CFG_OSTYPE in
CFG_OSTYPE=unknown-dragonfly
;;

OpenBSD)
CFG_OSTYPE=unknown-openbsd
;;

Darwin)
CFG_OSTYPE=apple-darwin
;;
Expand Down
26 changes: 26 additions & 0 deletions mk/cfg/x86_64-unknown-openbsd.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# x86_64-pc-openbsd-elf configuration
CC_x86_64-unknown-openbsd=$(CC)
CXX_x86_64-unknown-openbsd=$(CXX)
CPP_x86_64-unknown-openbsd=$(CPP)
AR_x86_64-unknown-openbsd=$(AR)
CFG_LIB_NAME_x86_64-unknown-openbsd=lib$(1).so
CFG_STATIC_LIB_NAME_x86_64-unknown-openbsd=lib$(1).a
CFG_LIB_GLOB_x86_64-unknown-openbsd=lib$(1)-*.so
CFG_LIB_DSYM_GLOB_x86_64-unknown-openbsd=$(1)-*.dylib.dSYM
CFG_JEMALLOC_CFLAGS_x86_64-unknown-openbsd := -m64 -I/usr/include $(CFLAGS)
CFG_GCCISH_CFLAGS_x86_64-unknown-openbsd := -Wall -Werror -g -fPIC -m64 -I/usr/include $(CFLAGS)
CFG_GCCISH_LINK_FLAGS_x86_64-unknown-openbsd := -shared -fPIC -g -pthread -m64
CFG_GCCISH_DEF_FLAG_x86_64-unknown-openbsd := -Wl,--export-dynamic,--dynamic-list=
CFG_GCCISH_PRE_LIB_FLAGS_x86_64-unknown-openbsd := -Wl,-whole-archive
CFG_GCCISH_POST_LIB_FLAGS_x86_64-unknown-openbsd := -Wl,-no-whole-archive
CFG_DEF_SUFFIX_x86_64-unknown-openbsd := .bsd.def
CFG_LLC_FLAGS_x86_64-unknown-openbsd :=
CFG_INSTALL_NAME_x86_64-unknown-openbsd =
CFG_EXE_SUFFIX_x86_64-unknown-openbsd :=
CFG_WINDOWSY_x86_64-unknown-openbsd :=
CFG_UNIXY_x86_64-unknown-openbsd := 1
CFG_PATH_MUNGE_x86_64-unknown-openbsd :=
CFG_LDPATH_x86_64-unknown-openbsd :=
CFG_RUN_x86_64-unknown-openbsd=$(2)
CFG_RUN_TARG_x86_64-unknown-openbsd=$(call CFG_RUN_x86_64-unknown-openbsd,,$(2))
CFG_GNU_TRIPLE_x86_64-unknown-openbsd := x86_64-unknown-openbsd
17 changes: 9 additions & 8 deletions src/compiletest/compiletest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#![feature(std_misc)]
#![feature(test)]
#![feature(unicode)]
#![feature(env)]

#![deny(warnings)]

Expand All @@ -31,7 +32,7 @@ extern crate getopts;
#[macro_use]
extern crate log;

use std::os;
use std::env;
use std::old_io;
use std::old_io::fs;
use std::thunk::Thunk;
Expand All @@ -48,7 +49,7 @@ pub mod common;
pub mod errors;

pub fn main() {
let args = os::args();
let args = env::args().map(|s| s.into_string().unwrap()).collect();;
let config = parse_config(args);

if config.valgrind_path.is_none() && config.force_valgrind {
Expand Down Expand Up @@ -224,15 +225,15 @@ pub fn run_tests(config: &Config) {
//arm-linux-androideabi debug-info test uses remote debugger
//so, we test 1 task at once.
// also trying to isolate problems with adb_run_wrapper.sh ilooping
os::setenv("RUST_TEST_TASKS","1");
env::set_var("RUST_TEST_TASKS","1");
}

match config.mode {
DebugInfoLldb => {
// Some older versions of LLDB seem to have problems with multiple
// instances running in parallel, so only run one test task at a
// time.
os::setenv("RUST_TEST_TASKS", "1");
env::set_var("RUST_TEST_TASKS", "1");
}
_ => { /* proceed */ }
}
Expand All @@ -245,7 +246,7 @@ pub fn run_tests(config: &Config) {
old_io::test::raise_fd_limit();
// Prevent issue #21352 UAC blocking .exe containing 'patch' etc. on Windows
// If #11207 is resolved (adding manifest to .exe) this becomes unnecessary
os::setenv("__COMPAT_LAYER", "RunAsInvoker");
env::set_var("__COMPAT_LAYER", "RunAsInvoker");
let res = test::run_tests_console(&opts, tests.into_iter().collect());
match res {
Ok(true) => {}
Expand Down Expand Up @@ -276,7 +277,7 @@ pub fn make_tests(config: &Config) -> Vec<test::TestDescAndFn> {
config.src_base.display());
let mut tests = Vec::new();
let dirs = fs::readdir(&config.src_base).unwrap();
for file in dirs.iter() {
for file in &dirs {
let file = file.clone();
debug!("inspecting file {:?}", file.display());
if is_test(config, &file) {
Expand Down Expand Up @@ -304,13 +305,13 @@ pub fn is_test(config: &Config, testfile: &Path) -> bool {

let mut valid = false;

for ext in valid_extensions.iter() {
for ext in &valid_extensions {
if name.ends_with(ext.as_slice()) {
valid = true;
}
}

for pre in invalid_prefixes.iter() {
for pre in &invalid_prefixes {
if name.starts_with(pre.as_slice()) {
valid = false;
}
Expand Down
8 changes: 4 additions & 4 deletions src/compiletest/procsrv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ pub fn run(lib_path: &str,
let mut cmd = Command::new(prog);
cmd.args(args);
add_target_env(&mut cmd, lib_path, aux_path);
for (key, val) in env.into_iter() {
for (key, val) in env {
cmd.env(key, val);
}

match cmd.spawn() {
Ok(mut process) => {
for input in input.iter() {
if let Some(input) = input {
process.stdin.as_mut().unwrap().write_all(input.as_bytes()).unwrap();
}
let ProcessOutput { status, output, error } =
Expand All @@ -72,13 +72,13 @@ pub fn run_background(lib_path: &str,
let mut cmd = Command::new(prog);
cmd.args(args);
add_target_env(&mut cmd, lib_path, aux_path);
for (key, val) in env.into_iter() {
for (key, val) in env {
cmd.env(key, val);
}

match cmd.spawn() {
Ok(mut process) => {
for input in input.iter() {
if let Some(input) = input {
process.stdin.as_mut().unwrap().write_all(input.as_bytes()).unwrap();
}

Expand Down
26 changes: 13 additions & 13 deletions src/compiletest/runtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ use std::old_io::process::ProcessExit;
use std::old_io::process;
use std::old_io::timer;
use std::old_io;
use std::os;
use std::env;
use std::iter::repeat;
use std::str;
use std::string::String;
Expand Down Expand Up @@ -547,7 +547,7 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
exe_file.as_str().unwrap().replace("\\", "\\\\"))[]);

// Add line breakpoints
for line in breakpoint_lines.iter() {
for line in &breakpoint_lines {
script_str.push_str(&format!("break '{}':{}\n",
testfile.filename_display(),
*line)[]);
Expand Down Expand Up @@ -683,13 +683,13 @@ fn run_debuginfo_lldb_test(config: &Config, props: &TestProps, testfile: &Path)
script_str.push_str("type category enable Rust\n");

// Set breakpoints on every line that contains the string "#break"
for line in breakpoint_lines.iter() {
for line in &breakpoint_lines {
script_str.push_str(format!("breakpoint set --line {}\n",
line).as_slice());
}

// Append the other commands
for line in commands.iter() {
for line in &commands {
script_str.push_str(line.as_slice());
script_str.push_str("\n");
}
Expand Down Expand Up @@ -847,7 +847,7 @@ fn check_debugger_output(debugger_run_result: &ProcRes, check_lines: &[String])
let mut rest = line.trim();
let mut first = true;
let mut failed = false;
for frag in check_fragments[i].iter() {
for frag in &check_fragments[i] {
let found = if first {
if rest.starts_with(frag.as_slice()) {
Some(0)
Expand Down Expand Up @@ -915,7 +915,7 @@ fn check_error_patterns(props: &TestProps,
missing_patterns[0]).as_slice(),
proc_res);
} else {
for pattern in missing_patterns.iter() {
for pattern in missing_patterns {
error(format!("error pattern '{}' not found!",
*pattern).as_slice());
}
Expand All @@ -935,7 +935,7 @@ fn check_no_compiler_crash(proc_res: &ProcRes) {
fn check_forbid_output(props: &TestProps,
output_to_check: &str,
proc_res: &ProcRes) {
for pat in props.forbid_output.iter() {
for pat in &props.forbid_output {
if output_to_check.contains(pat.as_slice()) {
fatal_proc_rec("forbidden pattern found in compiler output", proc_res);
}
Expand Down Expand Up @@ -1173,7 +1173,7 @@ fn compose_and_run_compiler(
// FIXME (#9639): This needs to handle non-utf8 paths
let extra_link_args = vec!("-L".to_string(), aux_dir.as_str().unwrap().to_string());

for rel_ab in props.aux_builds.iter() {
for rel_ab in &props.aux_builds {
let abs_ab = config.aux_base.join(rel_ab.as_slice());
let aux_props = header::load_props(&abs_ab);
let mut crate_type = if aux_props.no_prefer_dynamic {
Expand Down Expand Up @@ -1298,9 +1298,9 @@ fn make_lib_name(config: &Config, auxfile: &Path, testfile: &Path) -> Path {

fn make_exe_name(config: &Config, testfile: &Path) -> Path {
let mut f = output_base_name(config, testfile);
if !os::consts::EXE_SUFFIX.is_empty() {
if !env::consts::EXE_SUFFIX.is_empty() {
let mut fname = f.filename().unwrap().to_vec();
fname.extend(os::consts::EXE_SUFFIX.bytes());
fname.extend(env::consts::EXE_SUFFIX.bytes());
f.set_filename(fname);
}
f
Expand Down Expand Up @@ -1503,14 +1503,14 @@ fn _arm_exec_compiled_test(config: &Config,

// run test via adb_run_wrapper
runargs.push("shell".to_string());
for (key, val) in env.into_iter() {
for (key, val) in env {
runargs.push(format!("{}={}", key, val));
}
runargs.push(format!("{}/adb_run_wrapper.sh", config.adb_test_dir));
runargs.push(format!("{}", config.adb_test_dir));
runargs.push(format!("{}", prog_short));

for tv in args.args.iter() {
for tv in &args.args {
runargs.push(tv.to_string());
}
procsrv::run("",
Expand Down Expand Up @@ -1591,7 +1591,7 @@ fn _arm_push_aux_shared_library(config: &Config, testfile: &Path) {
let tdir = aux_output_dir_name(config, testfile);

let dirs = fs::readdir(&tdir).unwrap();
for file in dirs.iter() {
for file in &dirs {
if file.extension_str() == Some("so") {
// FIXME (#9639): This needs to handle non-utf8 paths
let copy_result = procsrv::run("",
Expand Down
13 changes: 7 additions & 6 deletions src/compiletest/util.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
Expand All @@ -11,7 +11,7 @@
use common::Config;

#[cfg(target_os = "windows")]
use std::os::getenv;
use std::env;

/// Conversion table from triple OS name to Rust SYSNAME
static OS_TABLE: &'static [(&'static str, &'static str)] = &[
Expand All @@ -23,10 +23,11 @@ static OS_TABLE: &'static [(&'static str, &'static str)] = &[
("linux", "linux"),
("freebsd", "freebsd"),
("dragonfly", "dragonfly"),
("openbsd", "openbsd"),
];

pub fn get_os(triple: &str) -> &'static str {
for &(triple_os, os) in OS_TABLE.iter() {
for &(triple_os, os) in OS_TABLE {
if triple.contains(triple_os) {
return os
}
Expand All @@ -39,11 +40,11 @@ pub fn make_new_path(path: &str) -> String {

// Windows just uses PATH as the library search path, so we have to
// maintain the current value while adding our own
match getenv(lib_path_env_var()) {
Some(curr) => {
match env::var_string(lib_path_env_var()) {
Ok(curr) => {
format!("{}{}{}", path, path_div(), curr)
}
None => path.to_string()
Err(..) => path.to_string()
}
}

Expand Down
3 changes: 1 addition & 2 deletions src/doc/grammar.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,7 @@ raw_string : '"' raw_string_body '"' | '#' raw_string '#' ;
common_escape : '\x5c'
| 'n' | 'r' | 't' | '0'
| 'x' hex_digit 2
unicode_escape : 'u' hex_digit 4
| 'U' hex_digit 8 ;
unicode_escape : 'u' '{' hex_digit+ 6 '}';
hex_digit : 'a' | 'b' | 'c' | 'd' | 'e' | 'f'
| 'A' | 'B' | 'C' | 'D' | 'E' | 'F'
Expand Down
Loading

0 comments on commit 7858cb4

Please sign in to comment.