Skip to content

Commit 7858cb4

Browse files
committed
Auto merge of rust-lang#21872 - alexcrichton:rollup, r=alexcrichton
2 parents eaf4c5c + 9ece22e commit 7858cb4

File tree

447 files changed

+5748
-3194
lines changed

Some content is hidden

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

447 files changed

+5748
-3194
lines changed

COPYRIGHT

+4-16
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ The following third party packages are included, and carry
2323
their own copyright notices and license terms:
2424

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

31-
for src/rt/vg/valgrind.h:
31+
for src/rt/valgrind/valgrind.h:
3232

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

77-
for src/rt/vg/memcheck.h:
77+
for src/rt/valgrind/memcheck.h:
7878

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

123-
* The auxiliary file src/etc/pkg/modpath.iss contains a
124-
library routine compiled, by Inno Setup, into the Windows
125-
installer binary. This file is licensed under the LGPL,
126-
version 3, but, in our legal interpretation, this does not
127-
affect the aggregate "collected work" license of the Rust
128-
distribution (MIT/ASL2) nor any other components of it. We
129-
believe that the terms governing distribution of the
130-
binary Windows installer built from modpath.iss are
131-
therefore LGPL, but not the terms governing distribution
132-
of any of the files installed by such an installer (such
133-
as the Rust compiler or runtime libraries themselves).
134-
135123
* The src/rt/miniz.c file, carrying an implementation of
136124
RFC1950/RFC1951 DEFLATE, by Rich Geldreich
137125
<[email protected]>. All uses of this file are

configure

+4
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,10 @@ case $CFG_OSTYPE in
374374
CFG_OSTYPE=unknown-dragonfly
375375
;;
376376

377+
OpenBSD)
378+
CFG_OSTYPE=unknown-openbsd
379+
;;
380+
377381
Darwin)
378382
CFG_OSTYPE=apple-darwin
379383
;;

mk/cfg/x86_64-unknown-openbsd.mk

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# x86_64-pc-openbsd-elf configuration
2+
CC_x86_64-unknown-openbsd=$(CC)
3+
CXX_x86_64-unknown-openbsd=$(CXX)
4+
CPP_x86_64-unknown-openbsd=$(CPP)
5+
AR_x86_64-unknown-openbsd=$(AR)
6+
CFG_LIB_NAME_x86_64-unknown-openbsd=lib$(1).so
7+
CFG_STATIC_LIB_NAME_x86_64-unknown-openbsd=lib$(1).a
8+
CFG_LIB_GLOB_x86_64-unknown-openbsd=lib$(1)-*.so
9+
CFG_LIB_DSYM_GLOB_x86_64-unknown-openbsd=$(1)-*.dylib.dSYM
10+
CFG_JEMALLOC_CFLAGS_x86_64-unknown-openbsd := -m64 -I/usr/include $(CFLAGS)
11+
CFG_GCCISH_CFLAGS_x86_64-unknown-openbsd := -Wall -Werror -g -fPIC -m64 -I/usr/include $(CFLAGS)
12+
CFG_GCCISH_LINK_FLAGS_x86_64-unknown-openbsd := -shared -fPIC -g -pthread -m64
13+
CFG_GCCISH_DEF_FLAG_x86_64-unknown-openbsd := -Wl,--export-dynamic,--dynamic-list=
14+
CFG_GCCISH_PRE_LIB_FLAGS_x86_64-unknown-openbsd := -Wl,-whole-archive
15+
CFG_GCCISH_POST_LIB_FLAGS_x86_64-unknown-openbsd := -Wl,-no-whole-archive
16+
CFG_DEF_SUFFIX_x86_64-unknown-openbsd := .bsd.def
17+
CFG_LLC_FLAGS_x86_64-unknown-openbsd :=
18+
CFG_INSTALL_NAME_x86_64-unknown-openbsd =
19+
CFG_EXE_SUFFIX_x86_64-unknown-openbsd :=
20+
CFG_WINDOWSY_x86_64-unknown-openbsd :=
21+
CFG_UNIXY_x86_64-unknown-openbsd := 1
22+
CFG_PATH_MUNGE_x86_64-unknown-openbsd :=
23+
CFG_LDPATH_x86_64-unknown-openbsd :=
24+
CFG_RUN_x86_64-unknown-openbsd=$(2)
25+
CFG_RUN_TARG_x86_64-unknown-openbsd=$(call CFG_RUN_x86_64-unknown-openbsd,,$(2))
26+
CFG_GNU_TRIPLE_x86_64-unknown-openbsd := x86_64-unknown-openbsd

src/compiletest/compiletest.rs

+9-8
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#![feature(std_misc)]
2323
#![feature(test)]
2424
#![feature(unicode)]
25+
#![feature(env)]
2526

2627
#![deny(warnings)]
2728

@@ -31,7 +32,7 @@ extern crate getopts;
3132
#[macro_use]
3233
extern crate log;
3334

34-
use std::os;
35+
use std::env;
3536
use std::old_io;
3637
use std::old_io::fs;
3738
use std::thunk::Thunk;
@@ -48,7 +49,7 @@ pub mod common;
4849
pub mod errors;
4950

5051
pub fn main() {
51-
let args = os::args();
52+
let args = env::args().map(|s| s.into_string().unwrap()).collect();;
5253
let config = parse_config(args);
5354

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

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

305306
let mut valid = false;
306307

307-
for ext in valid_extensions.iter() {
308+
for ext in &valid_extensions {
308309
if name.ends_with(ext.as_slice()) {
309310
valid = true;
310311
}
311312
}
312313

313-
for pre in invalid_prefixes.iter() {
314+
for pre in &invalid_prefixes {
314315
if name.starts_with(pre.as_slice()) {
315316
valid = false;
316317
}

src/compiletest/procsrv.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ pub fn run(lib_path: &str,
4040
let mut cmd = Command::new(prog);
4141
cmd.args(args);
4242
add_target_env(&mut cmd, lib_path, aux_path);
43-
for (key, val) in env.into_iter() {
43+
for (key, val) in env {
4444
cmd.env(key, val);
4545
}
4646

4747
match cmd.spawn() {
4848
Ok(mut process) => {
49-
for input in input.iter() {
49+
if let Some(input) = input {
5050
process.stdin.as_mut().unwrap().write_all(input.as_bytes()).unwrap();
5151
}
5252
let ProcessOutput { status, output, error } =
@@ -72,13 +72,13 @@ pub fn run_background(lib_path: &str,
7272
let mut cmd = Command::new(prog);
7373
cmd.args(args);
7474
add_target_env(&mut cmd, lib_path, aux_path);
75-
for (key, val) in env.into_iter() {
75+
for (key, val) in env {
7676
cmd.env(key, val);
7777
}
7878

7979
match cmd.spawn() {
8080
Ok(mut process) => {
81-
for input in input.iter() {
81+
if let Some(input) = input {
8282
process.stdin.as_mut().unwrap().write_all(input.as_bytes()).unwrap();
8383
}
8484

src/compiletest/runtest.rs

+13-13
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ use std::old_io::process::ProcessExit;
3131
use std::old_io::process;
3232
use std::old_io::timer;
3333
use std::old_io;
34-
use std::os;
34+
use std::env;
3535
use std::iter::repeat;
3636
use std::str;
3737
use std::string::String;
@@ -547,7 +547,7 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
547547
exe_file.as_str().unwrap().replace("\\", "\\\\"))[]);
548548

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

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

691691
// Append the other commands
692-
for line in commands.iter() {
692+
for line in &commands {
693693
script_str.push_str(line.as_slice());
694694
script_str.push_str("\n");
695695
}
@@ -847,7 +847,7 @@ fn check_debugger_output(debugger_run_result: &ProcRes, check_lines: &[String])
847847
let mut rest = line.trim();
848848
let mut first = true;
849849
let mut failed = false;
850-
for frag in check_fragments[i].iter() {
850+
for frag in &check_fragments[i] {
851851
let found = if first {
852852
if rest.starts_with(frag.as_slice()) {
853853
Some(0)
@@ -915,7 +915,7 @@ fn check_error_patterns(props: &TestProps,
915915
missing_patterns[0]).as_slice(),
916916
proc_res);
917917
} else {
918-
for pattern in missing_patterns.iter() {
918+
for pattern in missing_patterns {
919919
error(format!("error pattern '{}' not found!",
920920
*pattern).as_slice());
921921
}
@@ -935,7 +935,7 @@ fn check_no_compiler_crash(proc_res: &ProcRes) {
935935
fn check_forbid_output(props: &TestProps,
936936
output_to_check: &str,
937937
proc_res: &ProcRes) {
938-
for pat in props.forbid_output.iter() {
938+
for pat in &props.forbid_output {
939939
if output_to_check.contains(pat.as_slice()) {
940940
fatal_proc_rec("forbidden pattern found in compiler output", proc_res);
941941
}
@@ -1173,7 +1173,7 @@ fn compose_and_run_compiler(
11731173
// FIXME (#9639): This needs to handle non-utf8 paths
11741174
let extra_link_args = vec!("-L".to_string(), aux_dir.as_str().unwrap().to_string());
11751175

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

12991299
fn make_exe_name(config: &Config, testfile: &Path) -> Path {
13001300
let mut f = output_base_name(config, testfile);
1301-
if !os::consts::EXE_SUFFIX.is_empty() {
1301+
if !env::consts::EXE_SUFFIX.is_empty() {
13021302
let mut fname = f.filename().unwrap().to_vec();
1303-
fname.extend(os::consts::EXE_SUFFIX.bytes());
1303+
fname.extend(env::consts::EXE_SUFFIX.bytes());
13041304
f.set_filename(fname);
13051305
}
13061306
f
@@ -1503,14 +1503,14 @@ fn _arm_exec_compiled_test(config: &Config,
15031503

15041504
// run test via adb_run_wrapper
15051505
runargs.push("shell".to_string());
1506-
for (key, val) in env.into_iter() {
1506+
for (key, val) in env {
15071507
runargs.push(format!("{}={}", key, val));
15081508
}
15091509
runargs.push(format!("{}/adb_run_wrapper.sh", config.adb_test_dir));
15101510
runargs.push(format!("{}", config.adb_test_dir));
15111511
runargs.push(format!("{}", prog_short));
15121512

1513-
for tv in args.args.iter() {
1513+
for tv in &args.args {
15141514
runargs.push(tv.to_string());
15151515
}
15161516
procsrv::run("",
@@ -1591,7 +1591,7 @@ fn _arm_push_aux_shared_library(config: &Config, testfile: &Path) {
15911591
let tdir = aux_output_dir_name(config, testfile);
15921592

15931593
let dirs = fs::readdir(&tdir).unwrap();
1594-
for file in dirs.iter() {
1594+
for file in &dirs {
15951595
if file.extension_str() == Some("so") {
15961596
// FIXME (#9639): This needs to handle non-utf8 paths
15971597
let copy_result = procsrv::run("",

src/compiletest/util.rs

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -11,7 +11,7 @@
1111
use common::Config;
1212

1313
#[cfg(target_os = "windows")]
14-
use std::os::getenv;
14+
use std::env;
1515

1616
/// Conversion table from triple OS name to Rust SYSNAME
1717
static OS_TABLE: &'static [(&'static str, &'static str)] = &[
@@ -23,10 +23,11 @@ static OS_TABLE: &'static [(&'static str, &'static str)] = &[
2323
("linux", "linux"),
2424
("freebsd", "freebsd"),
2525
("dragonfly", "dragonfly"),
26+
("openbsd", "openbsd"),
2627
];
2728

2829
pub fn get_os(triple: &str) -> &'static str {
29-
for &(triple_os, os) in OS_TABLE.iter() {
30+
for &(triple_os, os) in OS_TABLE {
3031
if triple.contains(triple_os) {
3132
return os
3233
}
@@ -39,11 +40,11 @@ pub fn make_new_path(path: &str) -> String {
3940

4041
// Windows just uses PATH as the library search path, so we have to
4142
// maintain the current value while adding our own
42-
match getenv(lib_path_env_var()) {
43-
Some(curr) => {
43+
match env::var_string(lib_path_env_var()) {
44+
Ok(curr) => {
4445
format!("{}{}{}", path, path_div(), curr)
4546
}
46-
None => path.to_string()
47+
Err(..) => path.to_string()
4748
}
4849
}
4950

src/doc/grammar.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,7 @@ raw_string : '"' raw_string_body '"' | '#' raw_string '#' ;
196196
common_escape : '\x5c'
197197
| 'n' | 'r' | 't' | '0'
198198
| 'x' hex_digit 2
199-
unicode_escape : 'u' hex_digit 4
200-
| 'U' hex_digit 8 ;
199+
unicode_escape : 'u' '{' hex_digit+ 6 '}';
201200
202201
hex_digit : 'a' | 'b' | 'c' | 'd' | 'e' | 'f'
203202
| 'A' | 'B' | 'C' | 'D' | 'E' | 'F'

0 commit comments

Comments
 (0)