1
Fork 0

Auto merge of #49561 - Mark-Simulacrum:rollup, r=Mark-Simulacrum

Rollup of 3 pull requests

- Successful merges: #49451, #49498, #49549
- Failed merges:
This commit is contained in:
bors 2018-04-01 16:34:27 +00:00
commit 06fa27d7c8
10 changed files with 103 additions and 40 deletions

30
src/Cargo.lock generated
View file

@ -152,9 +152,6 @@ dependencies = [
[[package]] [[package]]
name = "build_helper" name = "build_helper"
version = "0.1.0" version = "0.1.0"
dependencies = [
"filetime 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]] [[package]]
name = "byteorder" name = "byteorder"
@ -270,11 +267,11 @@ dependencies = [
[[package]] [[package]]
name = "clippy" name = "clippy"
version = "0.0.189" version = "0.0.191"
dependencies = [ dependencies = [
"cargo_metadata 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", "cargo_metadata 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)",
"clippy-mini-macro-test 0.2.0", "clippy-mini-macro-test 0.2.0",
"clippy_lints 0.0.189", "clippy_lints 0.0.191",
"compiletest_rs 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "compiletest_rs 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"derive-new 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "derive-new 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -291,6 +288,26 @@ version = "0.2.0"
[[package]] [[package]]
name = "clippy_lints" name = "clippy_lints"
version = "0.0.189" version = "0.0.189"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"if_chain 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"itertools 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"pulldown-cmark 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"quine-mc_cluskey 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
"regex-syntax 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)",
"semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.35 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.35 (registry+https://github.com/rust-lang/crates.io-index)",
"toml 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-normalization 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"url 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "clippy_lints"
version = "0.0.191"
dependencies = [ dependencies = [
"if_chain 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "if_chain 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"itertools 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)", "itertools 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1398,7 +1415,7 @@ version = "0.126.0"
dependencies = [ dependencies = [
"cargo 0.27.0", "cargo 0.27.0",
"cargo_metadata 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", "cargo_metadata 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)",
"clippy_lints 0.0.189", "clippy_lints 0.0.189 (registry+https://github.com/rust-lang/crates.io-index)",
"env_logger 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)",
"failure 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"json 0.11.12 (registry+https://github.com/rust-lang/crates.io-index)", "json 0.11.12 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2631,6 +2648,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d4c819a1287eb618df47cc647173c5c4c66ba19d888a6e50d605672aed3140de" "checksum cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d4c819a1287eb618df47cc647173c5c4c66ba19d888a6e50d605672aed3140de"
"checksum chrono 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7c20ebe0b2b08b0aeddba49c609fe7957ba2e33449882cb186a180bc60682fa9" "checksum chrono 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7c20ebe0b2b08b0aeddba49c609fe7957ba2e33449882cb186a180bc60682fa9"
"checksum clap 2.31.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f0f16b89cbb9ee36d87483dc939fe9f1e13c05898d56d7b230a0d4dff033a536" "checksum clap 2.31.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f0f16b89cbb9ee36d87483dc939fe9f1e13c05898d56d7b230a0d4dff033a536"
"checksum clippy_lints 0.0.189 (registry+https://github.com/rust-lang/crates.io-index)" = "fef652630bbf8c5e89601220abd000f5057e8fa9db608484b5ebaad98e9bce53"
"checksum cmake 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)" = "56d741ea7a69e577f6d06b36b7dff4738f680593dc27a701ffa8506b73ce28bb" "checksum cmake 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)" = "56d741ea7a69e577f6d06b36b7dff4738f680593dc27a701ffa8506b73ce28bb"
"checksum commoncrypto 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d056a8586ba25a1e4d61cb090900e495952c7886786fc55f909ab2f819b69007" "checksum commoncrypto 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d056a8586ba25a1e4d61cb090900e495952c7886786fc55f909ab2f819b69007"
"checksum commoncrypto-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1fed34f46747aa73dfaa578069fd8279d2818ade2b55f38f22a9401c7f4083e2" "checksum commoncrypto-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1fed34f46747aa73dfaa578069fd8279d2818ade2b55f38f22a9401c7f4083e2"

View file

@ -1120,7 +1120,7 @@ pub fn run_cargo(build: &Build, cargo: &mut Command, stamp: &Path, is_check: boo
let max = max.unwrap(); let max = max.unwrap();
let max_path = max_path.unwrap(); let max_path = max_path.unwrap();
if stamp_contents == new_contents && max <= stamp_mtime { if stamp_contents == new_contents && max <= stamp_mtime {
build.verbose(&format!("not updating {:?}; contents equal and {} <= {}", build.verbose(&format!("not updating {:?}; contents equal and {:?} <= {:?}",
stamp, max, stamp_mtime)); stamp, max, stamp_mtime));
return deps return deps
} }

View file

@ -6,6 +6,3 @@ authors = ["The Rust Project Developers"]
[lib] [lib]
name = "build_helper" name = "build_helper"
path = "lib.rs" path = "lib.rs"
[dependencies]
filetime = "0.1"

View file

@ -10,14 +10,11 @@
#![deny(warnings)] #![deny(warnings)]
extern crate filetime;
use std::fs::File; use std::fs::File;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use std::process::{Command, Stdio}; use std::process::{Command, Stdio};
use std::{fs, env}; use std::{fs, env};
use std::time::{SystemTime, UNIX_EPOCH};
use filetime::FileTime;
/// A helper macro to `unwrap` a result except also print out details like: /// A helper macro to `unwrap` a result except also print out details like:
/// ///
@ -137,10 +134,8 @@ pub fn rerun_if_changed_anything_in_dir(dir: &Path) {
} }
/// Returns the last-modified time for `path`, or zero if it doesn't exist. /// Returns the last-modified time for `path`, or zero if it doesn't exist.
pub fn mtime(path: &Path) -> FileTime { pub fn mtime(path: &Path) -> SystemTime {
fs::metadata(path).map(|f| { fs::metadata(path).and_then(|f| f.modified()).unwrap_or(UNIX_EPOCH)
FileTime::from_last_modification_time(&f)
}).unwrap_or(FileTime::zero())
} }
/// Returns whether `dst` is up to date given that the file or files in `src` /// Returns whether `dst` is up to date given that the file or files in `src`
@ -157,9 +152,9 @@ pub fn up_to_date(src: &Path, dst: &Path) -> bool {
Err(e) => panic!("source {:?} failed to get metadata: {}", src, e), Err(e) => panic!("source {:?} failed to get metadata: {}", src, e),
}; };
if meta.is_dir() { if meta.is_dir() {
dir_up_to_date(src, &threshold) dir_up_to_date(src, threshold)
} else { } else {
FileTime::from_last_modification_time(&meta) <= threshold meta.modified().unwrap_or(UNIX_EPOCH) <= threshold
} }
} }
@ -226,13 +221,13 @@ pub fn sanitizer_lib_boilerplate(sanitizer_name: &str) -> Result<NativeLibBoiler
search_path) search_path)
} }
fn dir_up_to_date(src: &Path, threshold: &FileTime) -> bool { fn dir_up_to_date(src: &Path, threshold: SystemTime) -> bool {
t!(fs::read_dir(src)).map(|e| t!(e)).all(|e| { t!(fs::read_dir(src)).map(|e| t!(e)).all(|e| {
let meta = t!(e.metadata()); let meta = t!(e.metadata());
if meta.is_dir() { if meta.is_dir() {
dir_up_to_date(&e.path(), threshold) dir_up_to_date(&e.path(), threshold)
} else { } else {
FileTime::from_last_modification_time(&meta) < *threshold meta.modified().unwrap_or(UNIX_EPOCH) < threshold
} }
}) })
} }

View file

@ -348,6 +348,19 @@ details.
[issue-display-warnings]: https://github.com/rust-lang/rust/issues/41574 [issue-display-warnings]: https://github.com/rust-lang/rust/issues/41574
### `--edition`: control the edition of docs and doctests
Using this flag looks like this:
```bash
$ rustdoc src/lib.rs -Z unstable-options --edition 2018
$ rustdoc --test src/lib.rs -Z unstable-options --edition 2018
```
This flag allows rustdoc to treat your rust code as the given edition. It will compile doctests with
the given edition as well. As with `rustc`, the default edition that `rustdoc` will use is `2015`
(the first edition).
### `-Z force-unstable-if-unmarked` ### `-Z force-unstable-if-unmarked`
Using this flag looks like this: Using this flag looks like this:

View file

@ -26,6 +26,7 @@ use rustc_back::target::TargetTriple;
use syntax::ast::NodeId; use syntax::ast::NodeId;
use syntax::codemap; use syntax::codemap;
use syntax::edition::Edition;
use syntax::feature_gate::UnstableFeatures; use syntax::feature_gate::UnstableFeatures;
use errors; use errors;
use errors::emitter::ColorConfig; use errors::emitter::ColorConfig;
@ -123,7 +124,8 @@ pub fn run_core(search_paths: SearchPaths,
maybe_sysroot: Option<PathBuf>, maybe_sysroot: Option<PathBuf>,
allow_warnings: bool, allow_warnings: bool,
crate_name: Option<String>, crate_name: Option<String>,
force_unstable_if_unmarked: bool) -> (clean::Crate, RenderInfo) force_unstable_if_unmarked: bool,
edition: Edition) -> (clean::Crate, RenderInfo)
{ {
// Parse, resolve, and typecheck the given crate. // Parse, resolve, and typecheck the given crate.
@ -148,6 +150,7 @@ pub fn run_core(search_paths: SearchPaths,
actually_rustdoc: true, actually_rustdoc: true,
debugging_opts: config::DebuggingOptions { debugging_opts: config::DebuggingOptions {
force_unstable_if_unmarked, force_unstable_if_unmarked,
edition,
..config::basic_debugging_options() ..config::basic_debugging_options()
}, },
..config::basic_options().clone() ..config::basic_options().clone()

View file

@ -61,6 +61,7 @@ use std::path::{Path, PathBuf};
use std::process; use std::process;
use std::sync::mpsc::channel; use std::sync::mpsc::channel;
use syntax::edition::Edition;
use externalfiles::ExternalHtml; use externalfiles::ExternalHtml;
use rustc::session::search_paths::SearchPaths; use rustc::session::search_paths::SearchPaths;
use rustc::session::config::{ErrorOutputType, RustcOptGroup, nightly_options, Externs}; use rustc::session::config::{ErrorOutputType, RustcOptGroup, nightly_options, Externs};
@ -271,6 +272,11 @@ pub fn opts() -> Vec<RustcOptGroup> {
\"light-suffix.css\"", \"light-suffix.css\"",
"PATH") "PATH")
}), }),
unstable("edition", |o| {
o.optopt("", "edition",
"edition to use when compiling rust code (default: 2015)",
"EDITION")
}),
] ]
} }
@ -429,14 +435,23 @@ pub fn main_args(args: &[String]) -> isize {
let sort_modules_alphabetically = !matches.opt_present("sort-modules-by-appearance"); let sort_modules_alphabetically = !matches.opt_present("sort-modules-by-appearance");
let resource_suffix = matches.opt_str("resource-suffix"); let resource_suffix = matches.opt_str("resource-suffix");
let edition = matches.opt_str("edition").unwrap_or("2015".to_string());
let edition = match edition.parse() {
Ok(e) => e,
Err(_) => {
print_error("could not parse edition");
return 1;
}
};
match (should_test, markdown_input) { match (should_test, markdown_input) {
(true, true) => { (true, true) => {
return markdown::test(input, cfgs, libs, externs, test_args, maybe_sysroot, return markdown::test(input, cfgs, libs, externs, test_args, maybe_sysroot,
display_warnings, linker) display_warnings, linker, edition)
} }
(true, false) => { (true, false) => {
return test::run(Path::new(input), cfgs, libs, externs, test_args, crate_name, return test::run(Path::new(input), cfgs, libs, externs, test_args, crate_name,
maybe_sysroot, display_warnings, linker) maybe_sysroot, display_warnings, linker, edition)
} }
(false, true) => return markdown::render(Path::new(input), (false, true) => return markdown::render(Path::new(input),
output.unwrap_or(PathBuf::from("doc")), output.unwrap_or(PathBuf::from("doc")),
@ -446,7 +461,7 @@ pub fn main_args(args: &[String]) -> isize {
} }
let output_format = matches.opt_str("w"); let output_format = matches.opt_str("w");
let res = acquire_input(PathBuf::from(input), externs, &matches, move |out| { let res = acquire_input(PathBuf::from(input), externs, edition, &matches, move |out| {
let Output { krate, passes, renderinfo } = out; let Output { krate, passes, renderinfo } = out;
info!("going to format"); info!("going to format");
match output_format.as_ref().map(|s| &**s) { match output_format.as_ref().map(|s| &**s) {
@ -487,14 +502,15 @@ fn print_error<T>(error_message: T) where T: Display {
/// and files and then generates the necessary rustdoc output for formatting. /// and files and then generates the necessary rustdoc output for formatting.
fn acquire_input<R, F>(input: PathBuf, fn acquire_input<R, F>(input: PathBuf,
externs: Externs, externs: Externs,
edition: Edition,
matches: &getopts::Matches, matches: &getopts::Matches,
f: F) f: F)
-> Result<R, String> -> Result<R, String>
where R: 'static + Send, F: 'static + Send + FnOnce(Output) -> R { where R: 'static + Send, F: 'static + Send + FnOnce(Output) -> R {
match matches.opt_str("r").as_ref().map(|s| &**s) { match matches.opt_str("r").as_ref().map(|s| &**s) {
Some("rust") => Ok(rust_input(input, externs, matches, f)), Some("rust") => Ok(rust_input(input, externs, edition, matches, f)),
Some(s) => Err(format!("unknown input format: {}", s)), Some(s) => Err(format!("unknown input format: {}", s)),
None => Ok(rust_input(input, externs, matches, f)) None => Ok(rust_input(input, externs, edition, matches, f))
} }
} }
@ -520,8 +536,14 @@ fn parse_externs(matches: &getopts::Matches) -> Result<Externs, String> {
/// generated from the cleaned AST of the crate. /// generated from the cleaned AST of the crate.
/// ///
/// This form of input will run all of the plug/cleaning passes /// This form of input will run all of the plug/cleaning passes
fn rust_input<R, F>(cratefile: PathBuf, externs: Externs, matches: &getopts::Matches, f: F) -> R fn rust_input<R, F>(cratefile: PathBuf,
where R: 'static + Send, F: 'static + Send + FnOnce(Output) -> R { externs: Externs,
edition: Edition,
matches: &getopts::Matches,
f: F) -> R
where R: 'static + Send,
F: 'static + Send + FnOnce(Output) -> R
{
let mut default_passes = !matches.opt_present("no-defaults"); let mut default_passes = !matches.opt_present("no-defaults");
let mut passes = matches.opt_strs("passes"); let mut passes = matches.opt_strs("passes");
let mut plugins = matches.opt_strs("plugins"); let mut plugins = matches.opt_strs("plugins");
@ -570,7 +592,7 @@ where R: 'static + Send, F: 'static + Send + FnOnce(Output) -> R {
let (mut krate, renderinfo) = let (mut krate, renderinfo) =
core::run_core(paths, cfgs, externs, Input::File(cratefile), triple, maybe_sysroot, core::run_core(paths, cfgs, externs, Input::File(cratefile), triple, maybe_sysroot,
display_warnings, crate_name.clone(), display_warnings, crate_name.clone(),
force_unstable_if_unmarked); force_unstable_if_unmarked, edition);
info!("finished with rustc"); info!("finished with rustc");

View file

@ -18,6 +18,7 @@ use testing;
use rustc::session::search_paths::SearchPaths; use rustc::session::search_paths::SearchPaths;
use rustc::session::config::Externs; use rustc::session::config::Externs;
use syntax::codemap::DUMMY_SP; use syntax::codemap::DUMMY_SP;
use syntax::edition::Edition;
use externalfiles::{ExternalHtml, LoadStringError, load_string}; use externalfiles::{ExternalHtml, LoadStringError, load_string};
@ -139,7 +140,7 @@ pub fn render(input: &Path, mut output: PathBuf, matches: &getopts::Matches,
/// Run any tests/code examples in the markdown file `input`. /// Run any tests/code examples in the markdown file `input`.
pub fn test(input: &str, cfgs: Vec<String>, libs: SearchPaths, externs: Externs, pub fn test(input: &str, cfgs: Vec<String>, libs: SearchPaths, externs: Externs,
mut test_args: Vec<String>, maybe_sysroot: Option<PathBuf>, mut test_args: Vec<String>, maybe_sysroot: Option<PathBuf>,
display_warnings: bool, linker: Option<PathBuf>) -> isize { display_warnings: bool, linker: Option<PathBuf>, edition: Edition) -> isize {
let input_str = match load_string(input) { let input_str = match load_string(input) {
Ok(s) => s, Ok(s) => s,
Err(LoadStringError::ReadFail) => return 1, Err(LoadStringError::ReadFail) => return 1,
@ -151,7 +152,7 @@ pub fn test(input: &str, cfgs: Vec<String>, libs: SearchPaths, externs: Externs,
let mut collector = Collector::new(input.to_owned(), cfgs, libs, externs, let mut collector = Collector::new(input.to_owned(), cfgs, libs, externs,
true, opts, maybe_sysroot, None, true, opts, maybe_sysroot, None,
Some(PathBuf::from(input)), Some(PathBuf::from(input)),
linker); linker, edition);
find_testable_code(&input_str, &mut collector, DUMMY_SP, None); find_testable_code(&input_str, &mut collector, DUMMY_SP, None);
test_args.insert(0, "rustdoctest".to_string()); test_args.insert(0, "rustdoctest".to_string());
testing::test_main(&test_args, collector.tests, testing::test_main(&test_args, collector.tests,

View file

@ -34,6 +34,7 @@ use rustc_metadata::cstore::CStore;
use rustc_resolve::MakeGlobMap; use rustc_resolve::MakeGlobMap;
use syntax::ast; use syntax::ast;
use syntax::codemap::CodeMap; use syntax::codemap::CodeMap;
use syntax::edition::Edition;
use syntax::feature_gate::UnstableFeatures; use syntax::feature_gate::UnstableFeatures;
use syntax::with_globals; use syntax::with_globals;
use syntax_pos::{BytePos, DUMMY_SP, Pos, Span, FileName}; use syntax_pos::{BytePos, DUMMY_SP, Pos, Span, FileName};
@ -57,7 +58,8 @@ pub fn run(input_path: &Path,
crate_name: Option<String>, crate_name: Option<String>,
maybe_sysroot: Option<PathBuf>, maybe_sysroot: Option<PathBuf>,
display_warnings: bool, display_warnings: bool,
linker: Option<PathBuf>) linker: Option<PathBuf>,
edition: Edition)
-> isize { -> isize {
let input = config::Input::File(input_path.to_owned()); let input = config::Input::File(input_path.to_owned());
@ -70,6 +72,10 @@ pub fn run(input_path: &Path,
unstable_features: UnstableFeatures::from_environment(), unstable_features: UnstableFeatures::from_environment(),
lint_cap: Some(::rustc::lint::Level::Allow), lint_cap: Some(::rustc::lint::Level::Allow),
actually_rustdoc: true, actually_rustdoc: true,
debugging_opts: config::DebuggingOptions {
edition,
..config::basic_debugging_options()
},
..config::basic_options().clone() ..config::basic_options().clone()
}; };
@ -117,7 +123,8 @@ pub fn run(input_path: &Path,
maybe_sysroot, maybe_sysroot,
Some(codemap), Some(codemap),
None, None,
linker); linker,
edition);
{ {
let map = hir::map::map_crate(&sess, &cstore, &mut hir_forest, &defs); let map = hir::map::map_crate(&sess, &cstore, &mut hir_forest, &defs);
@ -177,8 +184,7 @@ fn run_test(test: &str, cratename: &str, filename: &FileName, line: usize,
externs: Externs, externs: Externs,
should_panic: bool, no_run: bool, as_test_harness: bool, should_panic: bool, no_run: bool, as_test_harness: bool,
compile_fail: bool, mut error_codes: Vec<String>, opts: &TestOptions, compile_fail: bool, mut error_codes: Vec<String>, opts: &TestOptions,
maybe_sysroot: Option<PathBuf>, maybe_sysroot: Option<PathBuf>, linker: Option<PathBuf>, edition: Edition) {
linker: Option<PathBuf>) {
// the test harness wants its own `main` & top level functions, so // the test harness wants its own `main` & top level functions, so
// never wrap the test in `fn main() { ... }` // never wrap the test in `fn main() { ... }`
let (test, line_offset) = make_test(test, Some(cratename), as_test_harness, opts); let (test, line_offset) = make_test(test, Some(cratename), as_test_harness, opts);
@ -204,6 +210,10 @@ fn run_test(test: &str, cratename: &str, filename: &FileName, line: usize,
}, },
test: as_test_harness, test: as_test_harness,
unstable_features: UnstableFeatures::from_environment(), unstable_features: UnstableFeatures::from_environment(),
debugging_opts: config::DebuggingOptions {
edition,
..config::basic_debugging_options()
},
..config::basic_options().clone() ..config::basic_options().clone()
}; };
@ -465,13 +475,14 @@ pub struct Collector {
codemap: Option<Lrc<CodeMap>>, codemap: Option<Lrc<CodeMap>>,
filename: Option<PathBuf>, filename: Option<PathBuf>,
linker: Option<PathBuf>, linker: Option<PathBuf>,
edition: Edition,
} }
impl Collector { impl Collector {
pub fn new(cratename: String, cfgs: Vec<String>, libs: SearchPaths, externs: Externs, pub fn new(cratename: String, cfgs: Vec<String>, libs: SearchPaths, externs: Externs,
use_headers: bool, opts: TestOptions, maybe_sysroot: Option<PathBuf>, use_headers: bool, opts: TestOptions, maybe_sysroot: Option<PathBuf>,
codemap: Option<Lrc<CodeMap>>, filename: Option<PathBuf>, codemap: Option<Lrc<CodeMap>>, filename: Option<PathBuf>,
linker: Option<PathBuf>) -> Collector { linker: Option<PathBuf>, edition: Edition) -> Collector {
Collector { Collector {
tests: Vec::new(), tests: Vec::new(),
names: Vec::new(), names: Vec::new(),
@ -486,6 +497,7 @@ impl Collector {
codemap, codemap,
filename, filename,
linker, linker,
edition,
} }
} }
@ -505,6 +517,7 @@ impl Collector {
let opts = self.opts.clone(); let opts = self.opts.clone();
let maybe_sysroot = self.maybe_sysroot.clone(); let maybe_sysroot = self.maybe_sysroot.clone();
let linker = self.linker.clone(); let linker = self.linker.clone();
let edition = self.edition;
debug!("Creating test {}: {}", name, test); debug!("Creating test {}: {}", name, test);
self.tests.push(testing::TestDescAndFn { self.tests.push(testing::TestDescAndFn {
desc: testing::TestDesc { desc: testing::TestDesc {
@ -535,7 +548,8 @@ impl Collector {
error_codes, error_codes,
&opts, &opts,
maybe_sysroot, maybe_sysroot,
linker) linker,
edition)
})) }))
} { } {
Ok(()) => (), Ok(()) => (),

@ -1 +1 @@
Subproject commit b75618206cec71bd87ff7b07f0a8698ee854a2d1 Subproject commit b45801ff192e6f1bd3504c05e612a1004f52a24e