Skip to content

Commit c2f2480

Browse files
committed
---
yaml --- r: 175673 b: refs/heads/auto c: 48aa068 h: refs/heads/master i: 175671: 48d6e0f v: v3
1 parent b62a3a7 commit c2f2480

File tree

404 files changed

+6588
-6434
lines changed

Some content is hidden

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

404 files changed

+6588
-6434
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1010
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1111
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1212
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
13-
refs/heads/auto: dc27d29297e704d89e1a7fadbeafd44552bb2b93
13+
refs/heads/auto: 48aa068286e2cbe38bb399c0f76c03546c4998c3
1414
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1515
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1616
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/configure

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,7 @@ opt optimize-tests 1 "build tests with optimizations"
509509
opt libcpp 1 "build with llvm with libc++ instead of libstdc++ when using clang"
510510
opt llvm-assertions 1 "build LLVM with assertions"
511511
opt debug 1 "build with extra debug fun"
512+
opt ratchet-bench 0 "ratchet benchmarks"
512513
opt fast-make 0 "use .gitmodules as timestamp for submodule deps"
513514
opt ccache 0 "invoke gcc/clang via ccache to reuse object files between builds"
514515
opt local-rust 0 "use an installed rustc rather than downloading a snapshot"

branches/auto/mk/cfg/aarch64-linux-android.mk

Lines changed: 0 additions & 30 deletions
This file was deleted.

branches/auto/mk/rt.mk

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,6 @@ else ifeq ($(OSTYPE_$(1)), apple-ios)
141141
JEMALLOC_ARGS_$(1) := --disable-tls
142142
else ifeq ($(OSTYPE_$(1)), linux-androideabi)
143143
JEMALLOC_ARGS_$(1) := --disable-tls
144-
else ifeq ($(OSTYPE_$(1)), linux-android)
145-
JEMALLOC_ARGS_$(1) := --disable-tls
146144
endif
147145

148146
################################################################################

branches/auto/mk/tests.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,6 @@ tidy:
300300
| grep '^$(S)src/libbacktrace' -v \
301301
| grep '^$(S)src/rust-installer' -v \
302302
| xargs $(CFG_PYTHON) $(S)src/etc/check-binaries.py
303-
$(Q) $(CFG_PYTHON) $(S)src/etc/errorck.py $(S)src/
304303

305304

306305
endif

branches/auto/src/compiletest/common.rs

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use std::fmt;
1313
use std::str::FromStr;
1414
use regex::Regex;
1515

16-
#[derive(Clone, PartialEq, Debug)]
16+
#[derive(Clone, PartialEq)]
1717
pub enum Mode {
1818
CompileFail,
1919
RunFail,
@@ -43,9 +43,9 @@ impl FromStr for Mode {
4343
}
4444
}
4545

46-
impl fmt::Display for Mode {
46+
impl fmt::String for Mode {
4747
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
48-
fmt::Display::fmt(match *self {
48+
fmt::String::fmt(match *self {
4949
CompileFail => "compile-fail",
5050
RunFail => "run-fail",
5151
RunPass => "run-pass",
@@ -58,6 +58,12 @@ impl fmt::Display for Mode {
5858
}
5959
}
6060

61+
impl fmt::Show for Mode {
62+
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
63+
fmt::String::fmt(self, f)
64+
}
65+
}
66+
6167
#[derive(Clone)]
6268
pub struct Config {
6369
// The library paths required for running the compiler
@@ -109,6 +115,20 @@ pub struct Config {
109115
// Write out a parseable log of tests that were run
110116
pub logfile: Option<Path>,
111117

118+
// Write out a json file containing any metrics of the run
119+
pub save_metrics: Option<Path>,
120+
121+
// Write and ratchet a metrics file
122+
pub ratchet_metrics: Option<Path>,
123+
124+
// Percent change in metrics to consider noise
125+
pub ratchet_noise_percent: Option<f64>,
126+
127+
// "Shard" of the testsuite to pub run: this has the form of
128+
// two numbers (a,b), and causes only those tests with
129+
// positional order equal to a mod b to run.
130+
pub test_shard: Option<(uint,uint)>,
131+
112132
// A command line to prefix program execution with,
113133
// for running under valgrind
114134
pub runtool: Option<String>,

branches/auto/src/compiletest/compiletest.rs

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ pub fn parse_config(args: Vec<String> ) -> Config {
7777
optopt("", "target-rustcflags", "flags to pass to rustc for target", "FLAGS"),
7878
optflag("", "verbose", "run tests verbosely, showing all output"),
7979
optopt("", "logfile", "file to log test execution to", "FILE"),
80+
optopt("", "save-metrics", "file to save metrics to", "FILE"),
81+
optopt("", "ratchet-metrics", "file to ratchet metrics against", "FILE"),
82+
optopt("", "ratchet-noise-percent",
83+
"percent change in metrics to consider noise", "N"),
8084
optflag("", "jit", "run tests under the JIT"),
8185
optopt("", "target", "the target to build for", "TARGET"),
8286
optopt("", "host", "the host to build for", "HOST"),
@@ -86,6 +90,7 @@ pub fn parse_config(args: Vec<String> ) -> Config {
8690
optopt("", "adb-path", "path to the android debugger", "PATH"),
8791
optopt("", "adb-test-dir", "path to tests for the android debugger", "PATH"),
8892
optopt("", "lldb-python-dir", "directory containing LLDB's python module", "PATH"),
93+
optopt("", "test-shard", "run shard A, of B shards, worth of the testsuite", "A.B"),
8994
optflag("h", "help", "show this message"));
9095

9196
assert!(!args.is_empty());
@@ -147,6 +152,12 @@ pub fn parse_config(args: Vec<String> ) -> Config {
147152
filter: filter,
148153
cfail_regex: Regex::new(errors::EXPECTED_PATTERN).unwrap(),
149154
logfile: matches.opt_str("logfile").map(|s| Path::new(s)),
155+
save_metrics: matches.opt_str("save-metrics").map(|s| Path::new(s)),
156+
ratchet_metrics:
157+
matches.opt_str("ratchet-metrics").map(|s| Path::new(s)),
158+
ratchet_noise_percent:
159+
matches.opt_str("ratchet-noise-percent")
160+
.and_then(|s| s.as_slice().parse::<f64>()),
150161
runtool: matches.opt_str("runtool"),
151162
host_rustcflags: matches.opt_str("host-rustcflags"),
152163
target_rustcflags: matches.opt_str("target-rustcflags"),
@@ -165,6 +176,7 @@ pub fn parse_config(args: Vec<String> ) -> Config {
165176
opt_str2(matches.opt_str("adb-test-dir")).as_slice() &&
166177
!opt_str2(matches.opt_str("adb-test-dir")).is_empty(),
167178
lldb_python_dir: matches.opt_str("lldb-python-dir"),
179+
test_shard: test::opt_shard(matches.opt_str("test-shard")),
168180
verbose: matches.opt_present("verbose"),
169181
}
170182
}
@@ -198,6 +210,10 @@ pub fn log_config(config: &Config) {
198210
logv(c, format!("adb_test_dir: {:?}", config.adb_test_dir));
199211
logv(c, format!("adb_device_status: {}",
200212
config.adb_device_status));
213+
match config.test_shard {
214+
None => logv(c, "test_shard: (all)".to_string()),
215+
Some((a,b)) => logv(c, format!("test_shard: {}.{}", a, b))
216+
}
201217
logv(c, format!("verbose: {}", config.verbose));
202218
logv(c, format!("\n"));
203219
}
@@ -248,9 +264,6 @@ pub fn run_tests(config: &Config) {
248264
// parallel (especially when we have lots and lots of child processes).
249265
// For context, see #8904
250266
io::test::raise_fd_limit();
251-
// Prevent issue #21352 UAC blocking .exe containing 'patch' etc. on Windows
252-
// If #11207 is resolved (adding manifest to .exe) this becomes unnecessary
253-
os::setenv("__COMPAT_LAYER", "RunAsInvoker");
254267
let res = test::run_tests_console(&opts, tests.into_iter().collect());
255268
match res {
256269
Ok(true) => {}
@@ -271,8 +284,15 @@ pub fn test_opts(config: &Config) -> test::TestOpts {
271284
logfile: config.logfile.clone(),
272285
run_tests: true,
273286
run_benchmarks: true,
287+
ratchet_metrics: config.ratchet_metrics.clone(),
288+
ratchet_noise_percent: config.ratchet_noise_percent.clone(),
289+
save_metrics: config.save_metrics.clone(),
290+
test_shard: config.test_shard.clone(),
274291
nocapture: false,
275292
color: test::AutoColor,
293+
show_boxplot: false,
294+
boxplot_width: 50,
295+
show_all_stats: false,
276296
}
277297
}
278298

branches/auto/src/compiletest/header.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,8 @@ pub fn parse_name_value_directive(line: &str, directive: &str)
332332
let keycolon = format!("{}:", directive);
333333
match line.find_str(keycolon.as_slice()) {
334334
Some(colon) => {
335-
let value = line[(colon + keycolon.len()) .. line.len()].to_string();
335+
let value = line.slice(colon + keycolon.len(),
336+
line.len()).to_string();
336337
debug!("{}: {}", directive, value);
337338
Some(value)
338339
}

branches/auto/src/compiletest/runtest.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,6 @@ fn run_pretty_test(config: &Config, props: &TestProps, testfile: &Path) {
294294
let aux_dir = aux_output_dir_name(config, testfile);
295295
// FIXME (#9639): This needs to handle non-utf8 paths
296296
let mut args = vec!("-".to_string(),
297-
"-Zunstable-options".to_string(),
298297
"--pretty".to_string(),
299298
pretty_type,
300299
format!("--target={}", config.target),
@@ -341,7 +340,7 @@ actual:\n\
341340
};
342341
// FIXME (#9639): This needs to handle non-utf8 paths
343342
let mut args = vec!("-".to_string(),
344-
"-Zno-trans".to_string(),
343+
"--no-trans".to_string(),
345344
"--crate-type=lib".to_string(),
346345
format!("--target={}", target),
347346
"-L".to_string(),
@@ -548,7 +547,7 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
548547

549548
// Add line breakpoints
550549
for line in breakpoint_lines.iter() {
551-
script_str.push_str(&format!("break '{}':{}\n",
550+
script_str.push_str(&format!("break '{:?}':{}\n",
552551
testfile.filename_display(),
553552
*line)[]);
554553
}
@@ -751,7 +750,7 @@ fn run_debuginfo_lldb_test(config: &Config, props: &TestProps, testfile: &Path)
751750
status: status,
752751
stdout: out,
753752
stderr: err,
754-
cmdline: format!("{:?}", cmd)
753+
cmdline: format!("{}", cmd)
755754
};
756755
}
757756
}
@@ -863,7 +862,7 @@ fn check_debugger_output(debugger_run_result: &ProcRes, check_lines: &[String])
863862
break;
864863
}
865864
Some(i) => {
866-
rest = &rest[(i + frag.len())..];
865+
rest = rest.slice_from(i + frag.len());
867866
}
868867
}
869868
first = false;
@@ -954,7 +953,7 @@ fn check_expected_errors(expected_errors: Vec<errors::ExpectedError> ,
954953
}
955954

956955
let prefixes = expected_errors.iter().map(|ee| {
957-
format!("{}:{}:", testfile.display(), ee.line)
956+
format!("{:?}:{}:", testfile.display(), ee.line)
958957
}).collect::<Vec<String> >();
959958

960959
#[cfg(windows)]
@@ -1046,7 +1045,7 @@ fn scan_until_char(haystack: &str, needle: char, idx: &mut uint) -> bool {
10461045
if *idx >= haystack.len() {
10471046
return false;
10481047
}
1049-
let opt = haystack[(*idx)..].find(needle);
1048+
let opt = haystack.slice_from(*idx).find(needle);
10501049
if opt.is_none() {
10511050
return false;
10521051
}

branches/auto/src/doc/intro.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -480,12 +480,14 @@ use std::sync::{Arc,Mutex};
480480
fn main() {
481481
let numbers = Arc::new(Mutex::new(vec![1is, 2, 3]));
482482
483-
for i in 0us..3 {
483+
for i in 0..3 {
484484
let number = numbers.clone();
485485
Thread::spawn(move || {
486486
let mut array = number.lock().unwrap();
487-
array[i] += 1;
488-
println!("numbers[{}] is {}", i, array[i]);
487+
488+
(*array)[i] += 1;
489+
490+
println!("numbers[{}] is {}", i, (*array)[i]);
489491
});
490492
}
491493
}

branches/auto/src/doc/reference.md

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -739,15 +739,6 @@ Rust syntax is restricted in two ways:
739739
* `concat!` : concatenates a comma-separated list of literals
740740
* `concat_idents!` : create a new identifier by concatenating the arguments
741741

742-
The following attributes are used for quasiquoting in procedural macros:
743-
744-
* `quote_expr!`
745-
* `quote_item!`
746-
* `quote_pat!`
747-
* `quote_stmt!`
748-
* `quote_tokens!`
749-
* `quote_ty!`
750-
751742
# Crates and source files
752743

753744
Rust is a *compiled* language. Its semantics obey a *phase distinction*
@@ -812,9 +803,8 @@ Crates contain [items](#items), each of which may have some number of
812803
## Items
813804

814805
```{.ebnf .gram}
815-
item : extern_crate_decl | use_decl | mod_item | fn_item | type_item
816-
| struct_item | enum_item | static_item | trait_item | impl_item
817-
| extern_block ;
806+
item : mod_item | fn_item | type_item | struct_item | enum_item
807+
| static_item | trait_item | impl_item | extern_block ;
818808
```
819809

820810
An _item_ is a component of a crate; some module items can be defined in crate
@@ -828,8 +818,6 @@ execution, and may reside in read-only memory.
828818

829819
There are several kinds of item:
830820

831-
* [`extern crate` declarations](#extern-crate-declarations)
832-
* [`use` declarations](#use-declarations)
833821
* [modules](#modules)
834822
* [functions](#functions)
835823
* [type definitions](#type-definitions)
@@ -866,10 +854,13 @@ no notion of type abstraction: there are no first-class "forall" types.
866854

867855
```{.ebnf .gram}
868856
mod_item : "mod" ident ( ';' | '{' mod '}' );
869-
mod : item * ;
857+
mod : [ view_item | item ] * ;
870858
```
871859

872-
A module is a container for zero or more [items](#items).
860+
A module is a container for zero or more [view items](#view-items) and zero or
861+
more [items](#items). The view items manage the visibility of the items defined
862+
within the module, as well as the visibility of names from outside the module
863+
when referenced from inside the module.
873864

874865
A _module item_ is a module, surrounded in braces, named, and prefixed with the
875866
keyword `mod`. A module item introduces a new, named module into the tree of
@@ -927,6 +918,19 @@ mod thread {
927918
}
928919
```
929920

921+
#### View items
922+
923+
```{.ebnf .gram}
924+
view_item : extern_crate_decl | use_decl ;
925+
```
926+
927+
A view item manages the namespace of a module. View items do not define new
928+
items, but rather, simply change other items' visibility. There are two
929+
kinds of view items:
930+
931+
* [`extern crate` declarations](#extern-crate-declarations)
932+
* [`use` declarations](#use-declarations)
933+
930934
##### Extern crate declarations
931935

932936
```{.ebnf .gram}
@@ -2037,9 +2041,6 @@ type int8_t = i8;
20372041
item](#language-items) for more details.
20382042
- `test` - indicates that this function is a test function, to only be compiled
20392043
in case of `--test`.
2040-
- `should_fail` - indicates that this test function should panic, inverting the success condition.
2041-
- `cold` - The function is unlikely to be executed, so optimize it (and calls
2042-
to it) differently.
20432044

20442045
### Static-only attributes
20452046

@@ -2376,6 +2377,10 @@ These types help drive the compiler's analysis
23762377
: ___Needs filling in___
23772378
* `no_copy_bound`
23782379
: This type does not implement "copy", even if eligible.
2380+
* `no_send_bound`
2381+
: This type does not implement "send", even if eligible.
2382+
* `no_sync_bound`
2383+
: This type does not implement "sync", even if eligible.
23792384
* `eh_personality`
23802385
: ___Needs filling in___
23812386
* `exchange_free`
@@ -2886,12 +2891,13 @@ Point3d {y: 0, z: 10, .. base};
28862891
### Block expressions
28872892

28882893
```{.ebnf .gram}
2889-
block_expr : '{' [ stmt ';' | item ] *
2894+
block_expr : '{' [ view_item ] *
2895+
[ stmt ';' | item ] *
28902896
[ expr ] '}' ;
28912897
```
28922898

28932899
A _block expression_ is similar to a module in terms of the declarations that
2894-
are possible. Each block conceptually introduces a new namespace scope. Use
2900+
are possible. Each block conceptually introduces a new namespace scope. View
28952901
items can bring new names into scopes and declared items are in scope for only
28962902
the block itself.
28972903

0 commit comments

Comments
 (0)