Skip to content

Commit f25cc72

Browse files
committed
---
yaml --- r: 209627 b: refs/heads/try c: 00978a9 h: refs/heads/master i: 209625: b52468b 209623: e7bd83a v: v3
1 parent 63d883b commit f25cc72

File tree

530 files changed

+8286
-31016
lines changed

Some content is hidden

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

530 files changed

+8286
-31016
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 3e561f05c00cd180ec02db4ccab2840a4aba93d2
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: ba0e1cd8147d452c356aacb29fb87568ca26f111
5-
refs/heads/try: 810757935e38aeaabfd8359fe157e74c837221df
5+
refs/heads/try: 00978a9879d882002c59c5f3474fbe0b858963a7
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/Makefile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
#
7777
# * `CFG_ENABLE_VALGRIND=1` - Run tests under valgrind
7878
# * `VALGRIND_COMPILE=1` - Run the compiler itself under valgrind
79-
# (may require `CFG_ENABLE_VALGRIND`)
79+
# (requires `CFG_ENABLE_VALGRIND`)
8080
#
8181
# * `NO_REBUILD=1` - Don't rebootstrap when testing std
8282
# (and possibly other crates)

branches/try/configure

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,13 +192,15 @@ valopt_core() {
192192
then
193193
local UOP=$(echo $OP | tr '[:lower:]' '[:upper:]' | tr '\-' '\_')
194194
local V="CFG_${UOP}"
195+
local V_PROVIDED="${V}_PROVIDED"
195196
eval $V="$DEFAULT"
196197
for arg in $CFG_CONFIGURE_ARGS
197198
do
198199
if echo "$arg" | grep -q -- "--$OP="
199200
then
200201
val=$(echo "$arg" | cut -f2 -d=)
201202
eval $V=$val
203+
eval $V_PROVIDED=1
202204
fi
203205
done
204206
if [ "$SAVE" = "save" ]
@@ -247,8 +249,10 @@ opt_core() {
247249
if [ $DEFAULT -eq 0 ]
248250
then
249251
FLAG="enable"
252+
DEFAULT_FLAG="disable"
250253
else
251254
FLAG="disable"
255+
DEFAULT_FLAG="enable"
252256
DOC="don't $DOC"
253257
fi
254258

@@ -261,11 +265,19 @@ opt_core() {
261265
OP=$(echo $OP | tr 'a-z-' 'A-Z_')
262266
FLAG=$(echo $FLAG | tr 'a-z' 'A-Z')
263267
local V="CFG_${FLAG}_${OP}"
268+
local V_PROVIDED="CFG_${FLAG}_${OP}_PROVIDED"
264269
eval $V=1
270+
eval $V_PROVIDED=1
265271
if [ "$SAVE" = "save" ]
266272
then
267273
putvar $V
268274
fi
275+
elif [ "$arg" = "--${DEFAULT_FLAG}-${OP}" ]
276+
then
277+
OP=$(echo $OP | tr 'a-z-' 'A-Z_')
278+
DEFAULT_FLAG=$(echo $DEFAULT_FLAG | tr 'a-z' 'A-Z')
279+
local V_PROVIDED="CFG_${DEFAULT_FLAG}_${OP}_PROVIDED"
280+
eval $V_PROVIDED=1
269281
fi
270282
done
271283
else
@@ -633,8 +645,11 @@ esac
633645
# Adjust perf and debug options for debug mode
634646
if [ -n "$CFG_ENABLE_DEBUG" ]; then
635647
msg "debug mode enabled, setting performance options"
636-
CFG_DISABLE_OPTIMIZE=1
637-
CFG_DISABLE_OPTIMIZE_CXX=1
648+
if [ -z "$CFG_ENABLE_OPTIMIZE_PROVIDED" ]; then
649+
msg "optimization not explicitly enabled, disabling optimization"
650+
CFG_DISABLE_OPTIMIZE=1
651+
CFG_DISABLE_OPTIMIZE_CXX=1
652+
fi
638653
CFG_ENABLE_LLVM_ASSERTIONS=1
639654
CFG_ENABLE_DEBUG_ASSERTIONS=1
640655
CFG_ENABLE_DEBUG_JEMALLOC=1

branches/try/mk/crates.mk

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,19 @@
5252
TARGET_CRATES := libc std flate arena term \
5353
serialize getopts collections test rand \
5454
log graphviz core rbml alloc \
55-
unicode rustc_bitflags
55+
rustc_unicode rustc_bitflags
5656
RUSTC_CRATES := rustc rustc_typeck rustc_borrowck rustc_resolve rustc_driver \
57-
rustc_trans rustc_back rustc_llvm rustc_privacy rustc_lint
57+
rustc_trans rustc_back rustc_llvm rustc_privacy rustc_lint \
58+
rustc_data_structures
5859
HOST_CRATES := syntax $(RUSTC_CRATES) rustdoc fmt_macros
5960
CRATES := $(TARGET_CRATES) $(HOST_CRATES)
6061
TOOLS := compiletest rustdoc rustc rustbook
6162

6263
DEPS_core :=
6364
DEPS_libc := core
64-
DEPS_unicode := core
65+
DEPS_rustc_unicode := core
6566
DEPS_alloc := core libc native:jemalloc
66-
DEPS_std := core libc rand alloc collections unicode \
67+
DEPS_std := core libc rand alloc collections rustc_unicode \
6768
native:rust_builtin native:backtrace native:rustrt_native \
6869
rustc_bitflags
6970
DEPS_graphviz := std
@@ -80,9 +81,10 @@ DEPS_rustc_resolve := rustc log syntax
8081
DEPS_rustc_privacy := rustc log syntax
8182
DEPS_rustc_lint := rustc log syntax
8283
DEPS_rustc := syntax flate arena serialize getopts rbml \
83-
log graphviz rustc_llvm rustc_back
84+
log graphviz rustc_llvm rustc_back rustc_data_structures
8485
DEPS_rustc_llvm := native:rustllvm libc std
8586
DEPS_rustc_back := std syntax rustc_llvm flate log libc
87+
DEPS_rustc_data_structures := std log serialize
8688
DEPS_rustdoc := rustc rustc_driver native:hoedown serialize getopts \
8789
test rustc_lint
8890
DEPS_rustc_bitflags := core
@@ -94,7 +96,7 @@ DEPS_serialize := std log
9496
DEPS_rbml := std log serialize
9597
DEPS_term := std log
9698
DEPS_getopts := std
97-
DEPS_collections := core alloc unicode
99+
DEPS_collections := core alloc rustc_unicode
98100
DEPS_num := std
99101
DEPS_test := std getopts serialize rbml term native:rust_test_helpers
100102
DEPS_rand := core
@@ -115,11 +117,11 @@ ONLY_RLIB_libc := 1
115117
ONLY_RLIB_alloc := 1
116118
ONLY_RLIB_rand := 1
117119
ONLY_RLIB_collections := 1
118-
ONLY_RLIB_unicode := 1
120+
ONLY_RLIB_rustc_unicode := 1
119121
ONLY_RLIB_rustc_bitflags := 1
120122

121123
# Documented-by-default crates
122-
DOC_CRATES := std alloc collections core libc unicode
124+
DOC_CRATES := std alloc collections core libc rustc_unicode
123125

124126
################################################################################
125127
# You should not need to edit below this line

branches/try/mk/main.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ CFG_RELEASE_NUM=1.0.0
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
2020
# versions (section 9)
21-
CFG_PRERELEASE_VERSION=
21+
CFG_PRERELEASE_VERSION=.3
2222

2323
CFG_FILENAME_EXTRA=4e7c5e5c
2424

branches/try/mk/platform.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,9 @@ endif
4646
# see https://blog.mozilla.org/jseward/2012/06/05/valgrind-now-supports-jemalloc-builds-directly/
4747
ifdef CFG_VALGRIND
4848
CFG_VALGRIND += --error-exitcode=100 \
49-
--soname-synonyms=somalloc=NONE \
49+
--fair-sched=try \
5050
--quiet \
51+
--soname-synonyms=somalloc=NONE \
5152
--suppressions=$(CFG_SRC_DIR)src/etc/x86.supp \
5253
$(OS_SUPP)
5354
ifdef CFG_ENABLE_HELGRIND

branches/try/mk/tests.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@
1515

1616
# The names of crates that must be tested
1717

18-
# libcore/libunicode tests are in a separate crate
18+
# libcore/librustc_unicode tests are in a separate crate
1919
DEPS_coretest :=
2020
$(eval $(call RUST_CRATE,coretest))
2121

2222
DEPS_collectionstest :=
2323
$(eval $(call RUST_CRATE,collectionstest))
2424

25-
TEST_TARGET_CRATES = $(filter-out core unicode,$(TARGET_CRATES)) \
25+
TEST_TARGET_CRATES = $(filter-out core rustc_unicode,$(TARGET_CRATES)) \
2626
collectionstest coretest
2727
TEST_DOC_CRATES = $(DOC_CRATES)
2828
TEST_HOST_CRATES = $(filter-out rustc_typeck rustc_borrowck rustc_resolve \

branches/try/src/compiletest/compiletest.rs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@
1212

1313
#![feature(box_syntax)]
1414
#![feature(collections)]
15-
#![feature(old_io)]
1615
#![feature(rustc_private)]
17-
#![feature(unboxed_closures)]
1816
#![feature(std_misc)]
1917
#![feature(test)]
2018
#![feature(path_ext)]
2119
#![feature(str_char)]
20+
#![feature(libc)]
2221

2322
#![deny(warnings)]
2423

24+
extern crate libc;
2525
extern crate test;
2626
extern crate getopts;
2727

@@ -42,6 +42,7 @@ pub mod header;
4242
pub mod runtest;
4343
pub mod common;
4444
pub mod errors;
45+
mod raise_fd_limit;
4546

4647
pub fn main() {
4748
let config = parse_config(env::args().collect());
@@ -245,11 +246,7 @@ pub fn run_tests(config: &Config) {
245246
// sadly osx needs some file descriptor limits raised for running tests in
246247
// parallel (especially when we have lots and lots of child processes).
247248
// For context, see #8904
248-
#[allow(deprecated)]
249-
fn raise_fd_limit() {
250-
std::old_io::test::raise_fd_limit();
251-
}
252-
raise_fd_limit();
249+
unsafe { raise_fd_limit::raise_fd_limit(); }
253250
// Prevent issue #21352 UAC blocking .exe containing 'patch' etc. on Windows
254251
// If #11207 is resolved (adding manifest to .exe) this becomes unnecessary
255252
env::set_var("__COMPAT_LAYER", "RunAsInvoker");
@@ -371,7 +368,7 @@ pub fn make_metrics_test_closure(config: &Config, testfile: &Path) -> test::Test
371368
fn extract_gdb_version(full_version_line: Option<String>) -> Option<String> {
372369
match full_version_line {
373370
Some(ref full_version_line)
374-
if full_version_line.trim().len() > 0 => {
371+
if !full_version_line.trim().is_empty() => {
375372
let full_version_line = full_version_line.trim();
376373

377374
// used to be a regex "(^|[^0-9])([0-9]\.[0-9])([^0-9]|$)"
@@ -411,7 +408,7 @@ fn extract_lldb_version(full_version_line: Option<String>) -> Option<String> {
411408

412409
match full_version_line {
413410
Some(ref full_version_line)
414-
if full_version_line.trim().len() > 0 => {
411+
if !full_version_line.trim().is_empty() => {
415412
let full_version_line = full_version_line.trim();
416413

417414
for (pos, l) in full_version_line.char_indices() {
@@ -429,7 +426,7 @@ fn extract_lldb_version(full_version_line: Option<String>) -> Option<String> {
429426
let vers = full_version_line[pos + 5..].chars().take_while(|c| {
430427
c.is_digit(10)
431428
}).collect::<String>();
432-
if vers.len() > 0 { return Some(vers) }
429+
if !vers.is_empty() { return Some(vers) }
433430
}
434431
println!("Could not extract LLDB version from line '{}'",
435432
full_version_line);
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
/// darwin_fd_limit exists to work around an issue where launchctl on Mac OS X
12+
/// defaults the rlimit maxfiles to 256/unlimited. The default soft limit of 256
13+
/// ends up being far too low for our multithreaded scheduler testing, depending
14+
/// on the number of cores available.
15+
///
16+
/// This fixes issue #7772.
17+
#[cfg(any(target_os = "macos", target_os = "ios"))]
18+
#[allow(non_camel_case_types)]
19+
pub unsafe fn raise_fd_limit() {
20+
use libc;
21+
use std::cmp;
22+
use std::io;
23+
use std::mem::size_of_val;
24+
use std::ptr::null_mut;
25+
26+
type rlim_t = libc::uint64_t;
27+
28+
#[repr(C)]
29+
struct rlimit {
30+
rlim_cur: rlim_t,
31+
rlim_max: rlim_t
32+
}
33+
extern {
34+
// name probably doesn't need to be mut, but the C function doesn't
35+
// specify const
36+
fn sysctl(name: *mut libc::c_int, namelen: libc::c_uint,
37+
oldp: *mut libc::c_void, oldlenp: *mut libc::size_t,
38+
newp: *mut libc::c_void, newlen: libc::size_t) -> libc::c_int;
39+
fn getrlimit(resource: libc::c_int, rlp: *mut rlimit) -> libc::c_int;
40+
fn setrlimit(resource: libc::c_int, rlp: *const rlimit) -> libc::c_int;
41+
}
42+
static CTL_KERN: libc::c_int = 1;
43+
static KERN_MAXFILESPERPROC: libc::c_int = 29;
44+
static RLIMIT_NOFILE: libc::c_int = 8;
45+
46+
// The strategy here is to fetch the current resource limits, read the
47+
// kern.maxfilesperproc sysctl value, and bump the soft resource limit for
48+
// maxfiles up to the sysctl value.
49+
50+
// Fetch the kern.maxfilesperproc value
51+
let mut mib: [libc::c_int; 2] = [CTL_KERN, KERN_MAXFILESPERPROC];
52+
let mut maxfiles: libc::c_int = 0;
53+
let mut size: libc::size_t = size_of_val(&maxfiles) as libc::size_t;
54+
if sysctl(&mut mib[0], 2, &mut maxfiles as *mut _ as *mut _, &mut size,
55+
null_mut(), 0) != 0 {
56+
let err = io::Error::last_os_error();
57+
panic!("raise_fd_limit: error calling sysctl: {}", err);
58+
}
59+
60+
// Fetch the current resource limits
61+
let mut rlim = rlimit{rlim_cur: 0, rlim_max: 0};
62+
if getrlimit(RLIMIT_NOFILE, &mut rlim) != 0 {
63+
let err = io::Error::last_os_error();
64+
panic!("raise_fd_limit: error calling getrlimit: {}", err);
65+
}
66+
67+
// Bump the soft limit to the smaller of kern.maxfilesperproc and the hard
68+
// limit
69+
rlim.rlim_cur = cmp::min(maxfiles as rlim_t, rlim.rlim_max);
70+
71+
// Set our newly-increased resource limit
72+
if setrlimit(RLIMIT_NOFILE, &rlim) != 0 {
73+
let err = io::Error::last_os_error();
74+
panic!("raise_fd_limit: error calling setrlimit: {}", err);
75+
}
76+
}
77+
78+
#[cfg(not(any(target_os = "macos", target_os = "ios")))]
79+
pub unsafe fn raise_fd_limit() {}

branches/try/src/compiletest/runtest.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ use std::net::TcpStream;
2929
use std::path::{Path, PathBuf};
3030
use std::process::{Command, Output, ExitStatus};
3131
use std::str;
32-
use std::time::Duration;
3332
use test::MetricMap;
3433

3534
pub fn run(config: Config, testfile: &Path) {
@@ -452,11 +451,7 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
452451
.expect(&format!("failed to exec `{:?}`", config.adb_path));
453452
loop {
454453
//waiting 1 second for gdbserver start
455-
#[allow(deprecated)]
456-
fn sleep() {
457-
::std::old_io::timer::sleep(Duration::milliseconds(1000));
458-
}
459-
sleep();
454+
::std::thread::sleep_ms(1000);
460455
if TcpStream::connect("127.0.0.1:5039").is_ok() {
461456
break
462457
}
@@ -869,7 +864,7 @@ fn check_debugger_output(debugger_run_result: &ProcRes, check_lines: &[String])
869864
}
870865
first = false;
871866
}
872-
if !failed && rest.len() == 0 {
867+
if !failed && rest.is_empty() {
873868
i += 1;
874869
}
875870
if i == num_check_lines {
@@ -1667,7 +1662,7 @@ fn _arm_push_aux_shared_library(config: &Config, testfile: &Path) {
16671662
// codegen tests (vs. clang)
16681663

16691664
fn append_suffix_to_stem(p: &Path, suffix: &str) -> PathBuf {
1670-
if suffix.len() == 0 {
1665+
if suffix.is_empty() {
16711666
p.to_path_buf()
16721667
} else {
16731668
let mut stem = p.file_stem().unwrap().to_os_string();

branches/try/src/doc/complement-design-faq.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Types which are [`Sync`][sync] are thread-safe when multiple shared
5656
references to them are used concurrently. Types which are not `Sync` are not
5757
thread-safe, and thus when used in a global require unsafe code to use.
5858

59-
[sync]: core/kinds/trait.Sync.html
59+
[sync]: core/marker/trait.Sync.html
6060

6161
### If mutable static items that implement `Sync` are safe, why is taking &mut SHARABLE unsafe?
6262

@@ -139,7 +139,7 @@ and explicitly calling the `clone` method. Making user-defined copy operators
139139
explicit surfaces the underlying complexity, forcing the developer to opt-in
140140
to potentially expensive operations.
141141

142-
[copy]: core/kinds/trait.Copy.html
142+
[copy]: core/marker/trait.Copy.html
143143
[clone]: core/clone/trait.Clone.html
144144

145145
## No move constructors

branches/try/src/doc/complement-lang-faq.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ Yes. Calling C code from Rust is simple and exactly as efficient as calling C co
124124

125125
Yes. The Rust code has to be exposed via an `extern` declaration, which makes it C-ABI compatible. Such a function can be passed to C code as a function pointer or, if given the `#[no_mangle]` attribute to disable symbol mangling, can be called directly from C code.
126126

127-
## Why aren't function signatures inferred? Why only local slots?
127+
## Why aren't function signatures inferred? Why only local variables?
128128

129129
* Mechanically, it simplifies the inference algorithm; inference only requires looking at one function at a time.
130130
* The same simplification goes double for human readers. A reader does not need an IDE running an inference algorithm across an entire crate to be able to guess at a function's argument types; it's always explicit and nearby.

0 commit comments

Comments
 (0)