Skip to content

Commit 7137961

Browse files
committed
---
yaml --- r: 276558 b: refs/heads/try c: f886939 h: refs/heads/master
1 parent 6392d84 commit 7137961

File tree

446 files changed

+14546
-7118
lines changed

Some content is hidden

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

446 files changed

+14546
-7118
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 6dbb0e86aec11050480beb76eade6fb805010ba7
33
refs/heads/snap-stage3: 235d77457d80b549dad3ac36d94f235208a1eafb
4-
refs/heads/try: bef69a116e0042fbd92dfa08de68da73765f4c14
4+
refs/heads/try: f8869394bb574134355334f0d55eed7be3188d97
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
77
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ build.
7777
7878
Download [MinGW from
7979
here](http://mingw-w64.org/doku.php/download/mingw-builds), and choose the
80-
`threads=win32,exceptions=dwarf/seh` flavor when installing. Also, make sure to install to a path without spaces in it. After installing,
80+
`version=4.9.x,threads=win32,exceptions=dwarf/seh` flavor when installing. Also, make sure to install to a path without spaces in it. After installing,
8181
add its `bin` directory to your `PATH`. This is due to [#28260](https://github.com/rust-lang/rust/issues/28260), in the future,
8282
installing from pacman should be just fine.
8383

branches/try/configure

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -969,11 +969,11 @@ then
969969
LLVM_VERSION=$($LLVM_CONFIG --version)
970970

971971
case $LLVM_VERSION in
972-
(3.[5-8]*)
972+
(3.[6-8]*)
973973
msg "found ok version of LLVM: $LLVM_VERSION"
974974
;;
975975
(*)
976-
err "bad LLVM version: $LLVM_VERSION, need >=3.5"
976+
err "bad LLVM version: $LLVM_VERSION, need >=3.6"
977977
;;
978978
esac
979979
fi
@@ -1034,7 +1034,7 @@ then
10341034
if [ -n "$CFG_OSX_CLANG_VERSION" ]
10351035
then
10361036
case $CFG_OSX_CLANG_VERSION in
1037-
(7.0* | 7.1* | 7.2*)
1037+
(7.0* | 7.1* | 7.2* | 7.3*)
10381038
step_msg "found ok version of APPLE CLANG: $CFG_OSX_CLANG_VERSION"
10391039
;;
10401040
(*)

branches/try/mk/crates.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ DEPS_rustc := syntax fmt_macros flate arena serialize getopts rbml rustc_front\
9797
log graphviz rustc_llvm rustc_back rustc_data_structures\
9898
rustc_const_eval
9999
DEPS_rustc_back := std syntax rustc_llvm rustc_front flate log libc
100-
DEPS_rustc_borrowck := rustc rustc_front log graphviz syntax
100+
DEPS_rustc_borrowck := rustc rustc_front rustc_mir log graphviz syntax
101101
DEPS_rustc_data_structures := std log serialize
102102
DEPS_rustc_driver := arena flate getopts graphviz libc rustc rustc_back rustc_borrowck \
103103
rustc_typeck rustc_mir rustc_resolve log syntax serialize rustc_llvm \

branches/try/mk/tests.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ $(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2)): \
383383
@$$(call E, rustc: $$@)
384384
$(Q)CFG_LLVM_LINKAGE_FILE=$$(LLVM_LINKAGE_PATH_$(2)) \
385385
$$(subst @,,$$(STAGE$(1)_T_$(2)_H_$(3))) -o $$@ $$< --test \
386-
-L "$$(RT_OUTPUT_DIR_$(2))" \
386+
-Cmetadata="test-crate" -L "$$(RT_OUTPUT_DIR_$(2))" \
387387
$$(LLVM_LIBDIR_RUSTFLAGS_$(2)) \
388388
$$(RUSTFLAGS_$(4))
389389

branches/try/src/bootstrap/build/check.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,11 @@ pub fn linkcheck(build: &Build, stage: u32, host: &str) {
1616
build.run(build.tool_cmd(&compiler, "linkchecker")
1717
.arg(build.out.join(host).join("doc")));
1818
}
19+
20+
pub fn cargotest(build: &Build, stage: u32, host: &str) {
21+
let ref compiler = Compiler::new(stage, host);
22+
build.run(build.tool_cmd(compiler, "cargotest")
23+
.env("RUSTC", build.compiler_path(compiler))
24+
.env("RUSTDOC", build.rustdoc(compiler))
25+
.arg(&build.cargo));
26+
}

branches/try/src/bootstrap/build/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,9 @@ impl Build {
183183
compile::tool(self, stage, target.target,
184184
"error_index_generator");
185185
}
186+
ToolCargoTest { stage } => {
187+
compile::tool(self, stage, target.target, "cargotest");
188+
}
186189
DocBook { stage } => {
187190
doc::rustbook(self, stage, target.target, "book", &doc_out);
188191
}
@@ -210,6 +213,9 @@ impl Build {
210213
CheckLinkcheck { stage } => {
211214
check::linkcheck(self, stage, target.target);
212215
}
216+
CheckCargoTest { stage } => {
217+
check::cargotest(self, stage, target.target);
218+
}
213219

214220
DistDocs { stage } => dist::docs(self, stage, target.target),
215221
DistMingw { _dummy } => dist::mingw(self, target.target),

branches/try/src/bootstrap/build/native.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,12 @@ pub fn llvm(build: &Build, target: &str) {
3939

4040
let _ = fs::remove_dir_all(&dst.join("build"));
4141
t!(fs::create_dir_all(&dst.join("build")));
42-
let assertions = if build.config.llvm_assertions {"ON"} else {"OFF"};
42+
let mut assertions = if build.config.llvm_assertions {"ON"} else {"OFF"};
43+
44+
// Disable LLVM assertions on ARM compilers until #32360 is fixed
45+
if target.contains("arm") && target.contains("gnu") {
46+
assertions = "OFF";
47+
}
4348

4449
// http://llvm.org/docs/CMake.html
4550
let mut cfg = cmake::Config::new(build.src.join("src/llvm"));

branches/try/src/bootstrap/build/step.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ macro_rules! targets {
4747
(tool_linkchecker, ToolLinkchecker { stage: u32 }),
4848
(tool_rustbook, ToolRustbook { stage: u32 }),
4949
(tool_error_index, ToolErrorIndex { stage: u32 }),
50+
(tool_cargotest, ToolCargoTest { stage: u32 }),
5051

5152
// Steps for long-running native builds. Ideally these wouldn't
5253
// actually exist and would be part of build scripts, but for now
@@ -73,6 +74,7 @@ macro_rules! targets {
7374
// target to depend on a bunch of others.
7475
(check, Check { stage: u32, compiler: Compiler<'a> }),
7576
(check_linkcheck, CheckLinkcheck { stage: u32 }),
77+
(check_cargotest, CheckCargoTest { stage: u32 }),
7678

7779
// Distribution targets, creating tarballs
7880
(dist, Dist { stage: u32 }),
@@ -292,6 +294,9 @@ impl<'a> Step<'a> {
292294
Source::CheckLinkcheck { stage } => {
293295
vec![self.tool_linkchecker(stage), self.doc(stage)]
294296
}
297+
Source::CheckCargoTest { stage } => {
298+
vec![self.tool_cargotest(stage)]
299+
}
295300

296301
Source::ToolLinkchecker { stage } => {
297302
vec![self.libstd(self.compiler(stage))]
@@ -300,6 +305,9 @@ impl<'a> Step<'a> {
300305
Source::ToolRustbook { stage } => {
301306
vec![self.librustc(self.compiler(stage))]
302307
}
308+
Source::ToolCargoTest { stage } => {
309+
vec![self.libstd(self.compiler(stage))]
310+
}
303311

304312
Source::DistDocs { stage } => vec![self.doc(stage)],
305313
Source::DistMingw { _dummy: _ } => Vec::new(),

branches/try/src/bootstrap/mk/Makefile.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ standalone-docs:
3838
$(Q)$(BOOTSTRAP) --step doc-standalone
3939
check:
4040
$(Q)$(BOOTSTRAP) --step check
41+
cargotest:
42+
$(Q)$(BOOTSTRAP) --step cargotest
4143
dist:
4244
$(Q)$(BOOTSTRAP) --step dist
4345

branches/try/src/compiletest/common.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ impl fmt::Display for Mode {
6969
#[derive(Clone)]
7070
pub struct Config {
7171
// The library paths required for running the compiler
72-
pub compile_lib_path: String,
72+
pub compile_lib_path: PathBuf,
7373

7474
// The library paths required for running compiled programs
75-
pub run_lib_path: String,
75+
pub run_lib_path: PathBuf,
7676

7777
// The rustc executable
7878
pub rustc_path: PathBuf,

branches/try/src/compiletest/compiletest.rs

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#![feature(rustc_private)]
1616
#![feature(str_char)]
1717
#![feature(test)]
18+
#![feature(question_mark)]
1819

1920
#![deny(warnings)]
2021

@@ -117,9 +118,17 @@ pub fn parse_config(args: Vec<String> ) -> Config {
117118
}
118119
}
119120

121+
fn make_absolute(path: PathBuf) -> PathBuf {
122+
if path.is_relative() {
123+
env::current_dir().unwrap().join(path)
124+
} else {
125+
path
126+
}
127+
}
128+
120129
Config {
121-
compile_lib_path: matches.opt_str("compile-lib-path").unwrap(),
122-
run_lib_path: matches.opt_str("run-lib-path").unwrap(),
130+
compile_lib_path: make_absolute(opt_path(matches, "compile-lib-path")),
131+
run_lib_path: make_absolute(opt_path(matches, "run-lib-path")),
123132
rustc_path: opt_path(matches, "rustc-path"),
124133
rustdoc_path: opt_path(matches, "rustdoc-path"),
125134
python: matches.opt_str("python").unwrap(),
@@ -280,16 +289,16 @@ fn collect_tests_from_dir(config: &Config,
280289
-> io::Result<()> {
281290
// Ignore directories that contain a file
282291
// `compiletest-ignore-dir`.
283-
for file in try!(fs::read_dir(dir)) {
284-
let file = try!(file);
292+
for file in fs::read_dir(dir)? {
293+
let file = file?;
285294
if file.file_name() == *"compiletest-ignore-dir" {
286295
return Ok(());
287296
}
288297
}
289298

290-
let dirs = try!(fs::read_dir(dir));
299+
let dirs = fs::read_dir(dir)?;
291300
for file in dirs {
292-
let file = try!(file);
301+
let file = file?;
293302
let file_path = file.path();
294303
debug!("inspecting file {:?}", file_path.display());
295304
if is_test(config, &file_path) {
@@ -310,11 +319,11 @@ fn collect_tests_from_dir(config: &Config,
310319
tests.push(make_test(config, &paths))
311320
} else if file_path.is_dir() {
312321
let relative_file_path = relative_dir_path.join(file.file_name());
313-
try!(collect_tests_from_dir(config,
314-
base,
315-
&file_path,
316-
&relative_file_path,
317-
tests));
322+
collect_tests_from_dir(config,
323+
base,
324+
&file_path,
325+
&relative_file_path,
326+
tests)?;
318327
}
319328
}
320329
Ok(())

branches/try/src/compiletest/errors.rs

Lines changed: 46 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,54 @@
99
// except according to those terms.
1010
use self::WhichLine::*;
1111

12+
use std::fmt;
1213
use std::fs::File;
1314
use std::io::BufReader;
1415
use std::io::prelude::*;
1516
use std::path::Path;
17+
use std::str::FromStr;
18+
19+
#[derive(Clone, Debug, PartialEq)]
20+
pub enum ErrorKind {
21+
Help,
22+
Error,
23+
Note,
24+
Suggestion,
25+
Warning,
26+
}
27+
28+
impl FromStr for ErrorKind {
29+
type Err = ();
30+
fn from_str(s: &str) -> Result<Self, Self::Err> {
31+
match &s.trim_right_matches(':') as &str {
32+
"HELP" => Ok(ErrorKind::Help),
33+
"ERROR" => Ok(ErrorKind::Error),
34+
"NOTE" => Ok(ErrorKind::Note),
35+
"SUGGESTION" => Ok(ErrorKind::Suggestion),
36+
"WARN" => Ok(ErrorKind::Warning),
37+
"WARNING" => Ok(ErrorKind::Warning),
38+
_ => Err(()),
39+
}
40+
}
41+
}
42+
43+
impl fmt::Display for ErrorKind {
44+
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
45+
match *self {
46+
ErrorKind::Help => write!(f, "help"),
47+
ErrorKind::Error => write!(f, "error"),
48+
ErrorKind::Note => write!(f, "note"),
49+
ErrorKind::Suggestion => write!(f, "suggestion"),
50+
ErrorKind::Warning => write!(f, "warning"),
51+
}
52+
}
53+
}
1654

1755
pub struct ExpectedError {
1856
pub line_num: usize,
19-
pub kind: String,
57+
/// What kind of message we expect (e.g. warning, error, suggestion).
58+
/// `None` if not specified or unknown message kind.
59+
pub kind: Option<ErrorKind>,
2060
pub msg: String,
2161
}
2262

@@ -81,11 +121,11 @@ fn parse_expected(last_nonfollow_error: Option<usize>,
81121
(false, line[start + tag.len()..].chars().take_while(|c| *c == '^').count())
82122
};
83123
let kind_start = start + tag.len() + adjusts + (follow as usize);
84-
let letters = line[kind_start..].chars();
85-
let kind = letters.skip_while(|c| c.is_whitespace())
86-
.take_while(|c| !c.is_whitespace())
87-
.flat_map(|c| c.to_lowercase())
88-
.collect::<String>();
124+
let kind = line[kind_start..].split_whitespace()
125+
.next()
126+
.expect("Encountered unexpected empty comment")
127+
.parse::<ErrorKind>()
128+
.ok();
89129
let letters = line[kind_start..].chars();
90130
let msg = letters.skip_while(|c| c.is_whitespace())
91131
.skip_while(|c| !c.is_whitespace())

0 commit comments

Comments
 (0)