Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rust-lang/rust
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 49bfe41bf0ed5d99716138a8426880caebfe8353
Choose a base ref
..
head repository: rust-lang/rust
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: f495fb88f2434bb2c02e694a435988584976f6f7
Choose a head ref
Showing 623 changed files with 5,048 additions and 4,679 deletions.
3 changes: 3 additions & 0 deletions Makefile.in
Original file line number Diff line number Diff line change
@@ -59,6 +59,9 @@
# * check-stage$(stage)-$(crate) - Test a crate in a specific stage
# * check-stage$(stage)-{rpass,rfail,cfail,rmake,...} - Run tests in src/test/
# * check-stage1-T-$(target)-H-$(host) - Run cross-compiled-tests
# * tidy-basic - show file / line stats
# * tidy-errors - show the highest rustc error code
# * tidy-features - show the status of language and lib features
#
# Then mix in some of these environment variables to harness the
# ultimate power of The Rust Build System.
13 changes: 9 additions & 4 deletions man/rustc.1
Original file line number Diff line number Diff line change
@@ -18,10 +18,15 @@ Display the help message
\fB\-\-cfg\fR SPEC
Configure the compilation environment
.TP
\fB\-L\fR PATH
Add a directory to the library search path
.TP
\fB\-l\fR NAME[:KIND]
\fB\-L\fR [KIND=]PATH
Add a directory to the library search path. The optional KIND can be one of:
dependency = only lookup transitive dependencies here
crate = only lookup local `extern crate` directives here
native = only lookup native libraries here
framework = only look for OSX frameworks here
all = look for anything here (the default)
.TP
\fB\-l\fR [KIND=]NAME
Link the generated crate(s) to the specified native library NAME. The optional
KIND can be one of, static, dylib, or framework. If omitted, dylib is assumed.
.TP
2 changes: 2 additions & 0 deletions mk/main.mk
Original file line number Diff line number Diff line change
@@ -72,6 +72,7 @@ endif
# numbers and dots here
CFG_VERSION_WIN = $(CFG_RELEASE_NUM)

CFG_INFO := $(info cfg: version $(CFG_VERSION))

######################################################################
# More configuration
@@ -179,6 +180,7 @@ endif

ifndef CFG_DISABLE_VALGRIND_RPASS
$(info cfg: enabling valgrind run-pass tests (CFG_ENABLE_VALGRIND_RPASS))
$(info cfg: valgrind-rpass command set to $(CFG_VALGRIND))
CFG_VALGRIND_RPASS :=$(CFG_VALGRIND)
else
CFG_VALGRIND_RPASS :=
74 changes: 23 additions & 51 deletions mk/tests.mk
Original file line number Diff line number Diff line change
@@ -162,7 +162,8 @@ $(foreach file,$(wildcard $(S)src/doc/trpl/*.md), \
######################################################################

# The main testing target. Tests lots of stuff.
check: cleantmptestlogs cleantestlibs check-notidy tidy
check: cleantmptestlogs cleantestlibs all check-stage2 tidy
$(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log

# As above but don't bother running tidy.
check-notidy: cleantmptestlogs cleantestlibs all check-stage2
@@ -235,57 +236,24 @@ cleantestlibs:
######################################################################

ifdef CFG_NOTIDY
.PHONY: tidy
tidy:
else

ALL_CS := $(wildcard $(S)src/rt/*.cpp \
$(S)src/rt/*/*.cpp \
$(S)src/rt/*/*/*.cpp \
$(S)src/rustllvm/*.cpp)
ALL_CS := $(filter-out $(S)src/rt/miniz.cpp \
$(wildcard $(S)src/rt/hoedown/src/*.c) \
$(wildcard $(S)src/rt/hoedown/bin/*.c) \
,$(ALL_CS))
ALL_HS := $(wildcard $(S)src/rt/*.h \
$(S)src/rt/*/*.h \
$(S)src/rt/*/*/*.h \
$(S)src/rustllvm/*.h)
ALL_HS := $(filter-out $(S)src/rt/valgrind/valgrind.h \
$(S)src/rt/valgrind/memcheck.h \
$(S)src/rt/msvc/typeof.h \
$(S)src/rt/msvc/stdint.h \
$(S)src/rt/msvc/inttypes.h \
$(wildcard $(S)src/rt/hoedown/src/*.h) \
$(wildcard $(S)src/rt/hoedown/bin/*.h) \
,$(ALL_HS))

# Run the tidy script in multiple parts to avoid huge 'echo' commands
tidy:
.PHONY: tidy
tidy: tidy-basic tidy-binaries tidy-errors tidy-features

endif

.PHONY: tidy-basic
tidy-basic:
@$(call E, check: formatting)
$(Q)find $(S)src -name '*.r[sc]' \
-and -not -regex '^$(S)src/jemalloc.*' \
-and -not -regex '^$(S)src/libuv.*' \
-and -not -regex '^$(S)src/llvm.*' \
-and -not -regex '^$(S)src/gyp.*' \
-and -not -regex '^$(S)src/libbacktrace.*' \
-print0 \
| xargs -0 -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
$(Q)find $(S)src/etc -name '*.py' \
| xargs -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
$(Q)find $(S)src/doc -name '*.js' \
| xargs -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
$(Q)find $(S)src/etc -name '*.sh' \
| xargs -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
$(Q)find $(S)src/etc -name '*.pl' \
| xargs -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
$(Q)find $(S)src/etc -name '*.c' \
| xargs -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
$(Q)find $(S)src/etc -name '*.h' \
| xargs -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
$(Q)echo $(ALL_CS) \
| xargs -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
$(Q)echo $(ALL_HS) \
| xargs -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
$(Q) $(CFG_PYTHON) $(S)src/etc/tidy.py $(S)src/

.PHONY: tidy-binaries
tidy-binaries:
@$(call E, check: binaries)
$(Q)find $(S)src -type f -perm +a+x \
-not -name '*.rs' -and -not -name '*.py' \
-and -not -name '*.sh' \
@@ -300,11 +268,16 @@ tidy:
| grep '^$(S)src/libbacktrace' -v \
| grep '^$(S)src/rust-installer' -v \
| xargs $(CFG_PYTHON) $(S)src/etc/check-binaries.py
$(Q) $(CFG_PYTHON) $(S)src/etc/errorck.py $(S)src/
$(Q) $(CFG_PYTHON) $(S)src/etc/featureck.py $(S)src/

.PHONY: tidy-errors
tidy-errors:
@$(call E, check: extended errors)
$(Q) $(CFG_PYTHON) $(S)src/etc/errorck.py $(S)src/

endif
.PHONY: tidy-features
tidy-features:
@$(call E, check: feature sanity)
$(Q) $(CFG_PYTHON) $(S)src/etc/featureck.py $(S)src/


######################################################################
@@ -639,7 +612,6 @@ CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) := \

ifdef CFG_VALGRIND_RPASS
ifdef GOOD_VALGRIND_$(2)
$(info cfg: valgrind-path set to $(CFG_VALGRIND_RPASS))
CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) += --valgrind-path "$(CFG_VALGRIND_RPASS)"
endif
endif
27 changes: 15 additions & 12 deletions src/compiletest/compiletest.rs
Original file line number Diff line number Diff line change
@@ -97,28 +97,31 @@ pub fn parse_config(args: Vec<String> ) -> Config {
assert!(!args.is_empty());
let argv0 = args[0].clone();
let args_ = args.tail();
if args[1].as_slice() == "-h" || args[1].as_slice() == "--help" {
if args[1] == "-h" || args[1] == "--help" {
let message = format!("Usage: {} [OPTIONS] [TESTNAME...]", argv0);
println!("{}", getopts::usage(message.as_slice(), groups.as_slice()));
println!("{}", getopts::usage(&message, &groups));
println!("");
panic!()
}

let matches =
&match getopts::getopts(args_.as_slice(), groups.as_slice()) {
&match getopts::getopts(args_, &groups) {
Ok(m) => m,
Err(f) => panic!("{:?}", f)
};

if matches.opt_present("h") || matches.opt_present("help") {
let message = format!("Usage: {} [OPTIONS] [TESTNAME...]", argv0);
println!("{}", getopts::usage(message.as_slice(), groups.as_slice()));
println!("{}", getopts::usage(&message, &groups));
println!("");
panic!()
}

fn opt_path(m: &getopts::Matches, nm: &str) -> Path {
Path::new(m.opt_str(nm).unwrap())
match m.opt_str(nm) {
Some(s) => Path::new(s),
None => panic!("no option (=path) found for {}", nm),
}
}

let filter = if !matches.free.is_empty() {
@@ -156,9 +159,9 @@ pub fn parse_config(args: Vec<String> ) -> Config {
adb_test_dir: opt_str2(matches.opt_str("adb-test-dir")),
adb_device_status:
"arm-linux-androideabi" ==
opt_str2(matches.opt_str("target")).as_slice() &&
opt_str2(matches.opt_str("target")) &&
"(none)" !=
opt_str2(matches.opt_str("adb-test-dir")).as_slice() &&
opt_str2(matches.opt_str("adb-test-dir")) &&
!opt_str2(matches.opt_str("adb-test-dir")).is_empty(),
lldb_python_dir: matches.opt_str("lldb-python-dir"),
verbose: matches.opt_present("verbose"),
@@ -201,7 +204,7 @@ pub fn log_config(config: &Config) {
pub fn opt_str<'a>(maybestr: &'a Option<String>) -> &'a str {
match *maybestr {
None => "(none)",
Some(ref s) => s.as_slice(),
Some(ref s) => s,
}
}

@@ -213,7 +216,7 @@ pub fn opt_str2(maybestr: Option<String>) -> String {
}

pub fn run_tests(config: &Config) {
if config.target.as_slice() == "arm-linux-androideabi" {
if config.target == "arm-linux-androideabi" {
match config.mode {
DebugInfoGdb => {
println!("arm-linux-androideabi debug-info \
@@ -306,13 +309,13 @@ pub fn is_test(config: &Config, testfile: &Path) -> bool {
let mut valid = false;

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

for pre in &invalid_prefixes {
if name.starts_with(pre.as_slice()) {
if name.starts_with(pre) {
valid = false;
}
}
@@ -359,7 +362,7 @@ pub fn make_metrics_test_closure(config: &Config, testfile: &Path) -> test::Test
let config = (*config).clone();
// FIXME (#9639): This needs to handle non-utf8 paths
let testfile = testfile.as_str().unwrap().to_string();
test::DynMetricFn(box move |: mm: &mut test::MetricMap| {
test::DynMetricFn(box move |mm: &mut test::MetricMap| {
runtest::run_metrics(config, testfile, mm)
})
}
2 changes: 1 addition & 1 deletion src/compiletest/errors.rs
Original file line number Diff line number Diff line change
@@ -44,7 +44,7 @@ pub fn load_errors(testfile: &Path) -> Vec<ExpectedError> {
rdr.lines().enumerate().filter_map(|(line_no, ln)| {
parse_expected(last_nonfollow_error,
line_no + 1,
ln.unwrap().as_slice())
&ln.unwrap())
.map(|(which, error)| {
match which {
FollowPrevious(_) => {}
28 changes: 14 additions & 14 deletions src/compiletest/header.rs
Original file line number Diff line number Diff line change
@@ -145,7 +145,7 @@ pub fn load_props(testfile: &Path) -> TestProps {

pub fn is_test_ignored(config: &Config, testfile: &Path) -> bool {
fn ignore_target(config: &Config) -> String {
format!("ignore-{}", util::get_os(config.target.as_slice()))
format!("ignore-{}", util::get_os(&config.target))
}
fn ignore_stage(config: &Config) -> String {
format!("ignore-{}",
@@ -169,8 +169,8 @@ pub fn is_test_ignored(config: &Config, testfile: &Path) -> bool {
.expect("Malformed GDB version directive");
// Ignore if actual version is smaller the minimum required
// version
gdb_version_to_int(actual_version.as_slice()) <
gdb_version_to_int(min_version.as_slice())
gdb_version_to_int(actual_version) <
gdb_version_to_int(min_version)
} else {
false
}
@@ -197,8 +197,8 @@ pub fn is_test_ignored(config: &Config, testfile: &Path) -> bool {
.expect("Malformed lldb version directive");
// Ignore if actual version is smaller the minimum required
// version
lldb_version_to_int(actual_version.as_slice()) <
lldb_version_to_int(min_version.as_slice())
lldb_version_to_int(actual_version) <
lldb_version_to_int(min_version)
} else {
false
}
@@ -209,8 +209,8 @@ pub fn is_test_ignored(config: &Config, testfile: &Path) -> bool {

let val = iter_header(testfile, |ln| {
!parse_name_directive(ln, "ignore-test") &&
!parse_name_directive(ln, ignore_target(config).as_slice()) &&
!parse_name_directive(ln, ignore_stage(config).as_slice()) &&
!parse_name_directive(ln, &ignore_target(config)) &&
!parse_name_directive(ln, &ignore_stage(config)) &&
!(config.mode == common::Pretty && parse_name_directive(ln, "ignore-pretty")) &&
!(config.target != config.host && parse_name_directive(ln, "ignore-cross-compile")) &&
!ignore_gdb(config, ln) &&
@@ -294,7 +294,7 @@ fn parse_pretty_compare_only(line: &str) -> bool {
fn parse_exec_env(line: &str) -> Option<(String, String)> {
parse_name_value_directive(line, "exec-env").map(|nv| {
// nv is either FOO or FOO=BAR
let mut strs: Vec<String> = nv.as_slice()
let mut strs: Vec<String> = nv
.splitn(1, '=')
.map(|s| s.to_string())
.collect();
@@ -330,7 +330,7 @@ fn parse_name_directive(line: &str, directive: &str) -> bool {
pub fn parse_name_value_directive(line: &str, directive: &str)
-> Option<String> {
let keycolon = format!("{}:", directive);
match line.find_str(keycolon.as_slice()) {
match line.find_str(&keycolon) {
Some(colon) => {
let value = line[(colon + keycolon.len()) .. line.len()].to_string();
debug!("{}: {}", directive, value);
@@ -344,16 +344,16 @@ pub fn gdb_version_to_int(version_string: &str) -> int {
let error_string = format!(
"Encountered GDB version string with unexpected format: {}",
version_string);
let error_string = error_string.as_slice();
let error_string = error_string;

let components: Vec<&str> = version_string.trim().split('.').collect();

if components.len() != 2 {
panic!("{}", error_string);
}

let major: int = components[0].parse().ok().expect(error_string);
let minor: int = components[1].parse().ok().expect(error_string);
let major: int = components[0].parse().ok().expect(&error_string);
let minor: int = components[1].parse().ok().expect(&error_string);

return major * 1000 + minor;
}
@@ -362,7 +362,7 @@ pub fn lldb_version_to_int(version_string: &str) -> int {
let error_string = format!(
"Encountered LLDB version string with unexpected format: {}",
version_string);
let error_string = error_string.as_slice();
let major: int = version_string.parse().ok().expect(error_string);
let error_string = error_string;
let major: int = version_string.parse().ok().expect(&error_string);
return major;
}
2 changes: 1 addition & 1 deletion src/compiletest/procsrv.rs
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ fn add_target_env(cmd: &mut Command, lib_path: &str, aux_path: Option<&str>) {

// Add the new dylib search path var
let var = DynamicLibrary::envvar();
let newpath = DynamicLibrary::create_path(path.as_slice());
let newpath = DynamicLibrary::create_path(&path);
let newpath = String::from_utf8(newpath).unwrap();
cmd.env(var.to_string(), newpath);
}
Loading