Rustup to rustc 1.40.0-nightly (2daa404e9
2019-10-02)
This commit is contained in:
parent
e676998b61
commit
0f938f68a5
4 changed files with 60 additions and 59 deletions
|
@ -12,7 +12,7 @@ fi
|
||||||
|
|
||||||
TARGET_TRIPLE=$(rustc -vV | grep host | cut -d: -f2 | tr -d " ")
|
TARGET_TRIPLE=$(rustc -vV | grep host | cut -d: -f2 | tr -d " ")
|
||||||
|
|
||||||
export RUSTFLAGS='-Cpanic=abort -Cdebuginfo=2 -Zcodegen-backend='$(pwd)'/target/'$CHANNEL'/librustc_codegen_cranelift.'$dylib_ext' --sysroot '$(pwd)'/build_sysroot/sysroot'
|
export RUSTFLAGS='-Cpanic=abort -Cdebuginfo=2 -Zpanic-abort-tests -Zcodegen-backend='$(pwd)'/target/'$CHANNEL'/librustc_codegen_cranelift.'$dylib_ext' --sysroot '$(pwd)'/build_sysroot/sysroot'
|
||||||
RUSTC="rustc $RUSTFLAGS -L crate=target/out --out-dir target/out"
|
RUSTC="rustc $RUSTFLAGS -L crate=target/out --out-dir target/out"
|
||||||
export RUSTC_LOG=warn # display metadata load errors
|
export RUSTC_LOG=warn # display metadata load errors
|
||||||
|
|
||||||
|
|
|
@ -1,68 +1,35 @@
|
||||||
From e77c222bb7ec0a99a69dcbb039c75fd1ea9db368 Mon Sep 17 00:00:00 2001
|
From e06143d3373293d0490df482261cd4a842f1a5c5 Mon Sep 17 00:00:00 2001
|
||||||
From: bjorn3 <bjorn3@users.noreply.github.com>
|
From: bjorn3 <bjorn3@users.noreply.github.com>
|
||||||
Date: Thu, 3 Oct 2019 16:22:21 +0200
|
Date: Thu, 3 Oct 2019 16:51:34 +0200
|
||||||
Subject: [PATCH] Fix libtest compilation
|
Subject: [PATCH] Fix libtest compilation
|
||||||
|
|
||||||
---
|
---
|
||||||
src/libtest/lib.rs | 30 +++++-------------------------
|
src/libtest/lib.rs | 28 ++++++++--------------------
|
||||||
1 file changed, 5 insertions(+), 25 deletions(-)
|
1 file changed, 8 insertions(+), 20 deletions(-)
|
||||||
|
|
||||||
diff --git a/src/libtest/lib.rs b/src/libtest/lib.rs
|
diff --git a/src/libtest/lib.rs b/src/libtest/lib.rs
|
||||||
index e441514..8e8b4df 100644
|
index 8b76080..9e65de2 100644
|
||||||
--- a/src/libtest/lib.rs
|
--- a/src/libtest/lib.rs
|
||||||
+++ b/src/libtest/lib.rs
|
+++ b/src/libtest/lib.rs
|
||||||
@@ -24,7 +24,6 @@
|
@@ -52,7 +52,7 @@ use std::fmt;
|
||||||
#![cfg_attr(any(unix, target_os = "cloudabi"), feature(libc, rustc_private))]
|
|
||||||
#![feature(nll)]
|
|
||||||
#![feature(set_stdio)]
|
|
||||||
-#![feature(panic_unwind)]
|
|
||||||
#![feature(staged_api)]
|
|
||||||
#![feature(termination_trait_lib)]
|
|
||||||
#![feature(test)]
|
|
||||||
@@ -34,16 +33,6 @@ use getopts;
|
|
||||||
extern crate libc;
|
|
||||||
use term;
|
|
||||||
|
|
||||||
-// FIXME(#54291): rustc and/or LLVM don't yet support building with panic-unwind
|
|
||||||
-// on aarch64-pc-windows-msvc, or thumbv7a-pc-windows-msvc
|
|
||||||
-// so we don't link libtest against libunwind (for the time being)
|
|
||||||
-// even though it means that libtest won't be fully functional on
|
|
||||||
-// these platforms.
|
|
||||||
-//
|
|
||||||
-// See also: https://github.com/rust-lang/rust/issues/54190#issuecomment-422904437
|
|
||||||
-#[cfg(not(all(windows, any(target_arch = "aarch64", target_arch = "arm"))))]
|
|
||||||
-extern crate panic_unwind;
|
|
||||||
-
|
|
||||||
pub use self::ColorConfig::*;
|
|
||||||
use self::NamePadding::*;
|
|
||||||
use self::OutputLocation::*;
|
|
||||||
@@ -61,7 +50,6 @@ use std::fmt;
|
|
||||||
use std::fs::File;
|
use std::fs::File;
|
||||||
use std::io;
|
use std::io;
|
||||||
use std::io::prelude::*;
|
use std::io::prelude::*;
|
||||||
-use std::panic::{catch_unwind, AssertUnwindSafe};
|
-use std::panic::{self, catch_unwind, AssertUnwindSafe, PanicInfo};
|
||||||
|
+use std::panic::{self, PanicInfo};
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use std::process;
|
use std::process;
|
||||||
use std::process::Termination;
|
use std::process::{ExitStatus, Command, Termination};
|
||||||
@@ -1434,7 +1422,7 @@ pub fn run_test(
|
@@ -1493,7 +1493,7 @@ pub fn run_test(
|
||||||
monitor_ch: Sender<MonitorMsg>,
|
|
||||||
nocapture: bool,
|
|
||||||
report_time: bool,
|
report_time: bool,
|
||||||
|
strategy: RunStrategy,
|
||||||
|
monitor_ch: Sender<MonitorMsg>,
|
||||||
- testfn: Box<dyn FnOnce() + Send>,
|
- testfn: Box<dyn FnOnce() + Send>,
|
||||||
+ testfn: Box<impl FnOnce() + Send + 'static>,
|
+ testfn: Box<impl FnOnce() + Send + 'static>,
|
||||||
concurrency: Concurrent,
|
concurrency: Concurrent,
|
||||||
) {
|
) {
|
||||||
// Buffer for capturing standard I/O
|
let name = desc.name.clone();
|
||||||
@@ -1457,7 +1445,7 @@ pub fn run_test(
|
@@ -1509,7 +1509,7 @@ pub fn run_test(
|
||||||
} else {
|
|
||||||
None
|
|
||||||
};
|
|
||||||
- let result = catch_unwind(AssertUnwindSafe(testfn));
|
|
||||||
+ let result = Ok(testfn());
|
|
||||||
let exec_time = start.map(|start| {
|
|
||||||
let duration = start.elapsed();
|
|
||||||
TestExecTime(duration)
|
|
||||||
@@ -1478,7 +1466,7 @@ pub fn run_test(
|
|
||||||
// If the platform is single-threaded we're just going to run
|
// If the platform is single-threaded we're just going to run
|
||||||
// the test synchronously, regardless of the concurrency
|
// the test synchronously, regardless of the concurrency
|
||||||
// level.
|
// level.
|
||||||
|
@ -71,25 +38,56 @@ index e441514..8e8b4df 100644
|
||||||
if concurrency == Concurrent::Yes && supports_threads {
|
if concurrency == Concurrent::Yes && supports_threads {
|
||||||
let cfg = thread::Builder::new().name(name.as_slice().to_owned());
|
let cfg = thread::Builder::new().name(name.as_slice().to_owned());
|
||||||
cfg.spawn(runtest).unwrap();
|
cfg.spawn(runtest).unwrap();
|
||||||
@@ -1498,16 +1486,8 @@ pub fn run_test(
|
@@ -1531,20 +1531,8 @@ pub fn run_test(
|
||||||
(benchfn.clone())(harness)
|
(benchfn.clone())(harness)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
- DynTestFn(f) => {
|
- DynTestFn(f) => {
|
||||||
- let cb = move || __rust_begin_short_backtrace(f);
|
- match strategy {
|
||||||
|
- RunStrategy::InProcess => (),
|
||||||
|
- _ => panic!("Cannot run dynamic test fn out-of-process"),
|
||||||
|
- };
|
||||||
- run_test_inner(
|
- run_test_inner(
|
||||||
- desc,
|
- desc,
|
||||||
- monitor_ch,
|
|
||||||
- opts.nocapture,
|
- opts.nocapture,
|
||||||
- opts.report_time,
|
- opts.report_time,
|
||||||
- Box::new(cb),
|
- strategy,
|
||||||
- concurrency,
|
- monitor_ch,
|
||||||
- )
|
- Box::new(move || __rust_begin_short_backtrace(f)),
|
||||||
|
- concurrency
|
||||||
|
- );
|
||||||
+ DynTestFn(_f) => {
|
+ DynTestFn(_f) => {
|
||||||
+ unimplemented!();
|
+ unimplemented!();
|
||||||
}
|
}
|
||||||
StaticTestFn(f) => run_test_inner(
|
StaticTestFn(f) => run_test_inner(
|
||||||
desc,
|
desc,
|
||||||
|
@@ -1604,7 +1592,7 @@ fn get_result_from_exit_code(desc: &TestDesc, code: i32) -> TestResult {
|
||||||
|
fn run_test_in_process(desc: TestDesc,
|
||||||
|
nocapture: bool,
|
||||||
|
report_time: bool,
|
||||||
|
- testfn: Box<dyn FnOnce() + Send>,
|
||||||
|
+ testfn: Box<impl FnOnce() + Send + 'static>,
|
||||||
|
monitor_ch: Sender<MonitorMsg>) {
|
||||||
|
// Buffer for capturing standard I/O
|
||||||
|
let data = Arc::new(Mutex::new(Vec::new()));
|
||||||
|
@@ -1623,7 +1611,7 @@ fn run_test_in_process(desc: TestDesc,
|
||||||
|
} else {
|
||||||
|
None
|
||||||
|
};
|
||||||
|
- let result = catch_unwind(AssertUnwindSafe(testfn));
|
||||||
|
+ let result = Ok::<(), Box<dyn Any + Send>>(testfn());
|
||||||
|
let exec_time = start.map(|start| {
|
||||||
|
let duration = start.elapsed();
|
||||||
|
TestExecTime(duration)
|
||||||
|
@@ -1688,7 +1676,7 @@ fn spawn_test_subprocess(desc: TestDesc, report_time: bool, monitor_ch: Sender<M
|
||||||
|
monitor_ch.send((desc.clone(), result, exec_time, test_output)).unwrap();
|
||||||
|
}
|
||||||
|
|
||||||
|
-fn run_test_in_spawned_subprocess(desc: TestDesc, testfn: Box<dyn FnOnce() + Send>) -> ! {
|
||||||
|
+fn run_test_in_spawned_subprocess(desc: TestDesc, testfn: Box<impl FnOnce() + Send + 'static>) -> ! {
|
||||||
|
let builtin_panic_hook = panic::take_hook();
|
||||||
|
let record_result = Arc::new(move |panic_info: Option<&'_ PanicInfo<'_>>| {
|
||||||
|
let test_result = match panic_info {
|
||||||
--
|
--
|
||||||
2.20.1
|
2.20.1
|
||||||
|
|
||||||
|
|
|
@ -219,7 +219,7 @@ fn run_aot(
|
||||||
rustc_incremental::finalize_session_directory(tcx.sess, tcx.crate_hash(LOCAL_CRATE));
|
rustc_incremental::finalize_session_directory(tcx.sess, tcx.crate_hash(LOCAL_CRATE));
|
||||||
|
|
||||||
let metadata_module = if need_metadata_module {
|
let metadata_module = if need_metadata_module {
|
||||||
tcx.sess.profiler(|p| p.start_activity("codegen crate metadata"));
|
let _timer = tcx.prof.generic_activity("codegen crate metadata");
|
||||||
let (metadata_cgu_name, tmp_file) = rustc::util::common::time(tcx.sess, "write compressed metadata", || {
|
let (metadata_cgu_name, tmp_file) = rustc::util::common::time(tcx.sess, "write compressed metadata", || {
|
||||||
use rustc::mir::mono::CodegenUnitNameBuilder;
|
use rustc::mir::mono::CodegenUnitNameBuilder;
|
||||||
|
|
||||||
|
@ -244,7 +244,6 @@ fn run_aot(
|
||||||
|
|
||||||
(metadata_cgu_name, tmp_file)
|
(metadata_cgu_name, tmp_file)
|
||||||
});
|
});
|
||||||
tcx.sess.profiler(|p| p.end_activity("codegen crate metadata"));
|
|
||||||
|
|
||||||
Some(CompiledModule {
|
Some(CompiledModule {
|
||||||
name: metadata_cgu_name,
|
name: metadata_cgu_name,
|
||||||
|
|
10
src/lib.rs
10
src/lib.rs
|
@ -10,6 +10,7 @@ extern crate rustc_data_structures;
|
||||||
extern crate rustc_driver;
|
extern crate rustc_driver;
|
||||||
extern crate rustc_fs_util;
|
extern crate rustc_fs_util;
|
||||||
extern crate rustc_incremental;
|
extern crate rustc_incremental;
|
||||||
|
extern crate rustc_index;
|
||||||
extern crate rustc_mir;
|
extern crate rustc_mir;
|
||||||
extern crate rustc_target;
|
extern crate rustc_target;
|
||||||
extern crate syntax;
|
extern crate syntax;
|
||||||
|
@ -74,11 +75,14 @@ mod prelude {
|
||||||
self, FnSig, Instance, InstanceDef, ParamEnv, PolyFnSig, Ty, TyCtxt, TypeAndMut,
|
self, FnSig, Instance, InstanceDef, ParamEnv, PolyFnSig, Ty, TyCtxt, TypeAndMut,
|
||||||
TypeFoldable,
|
TypeFoldable,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub use rustc_data_structures::{
|
pub use rustc_data_structures::{
|
||||||
fx::{FxHashMap, FxHashSet},
|
fx::{FxHashMap, FxHashSet},
|
||||||
indexed_vec::Idx,
|
|
||||||
sync::Lrc,
|
sync::Lrc,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
pub use rustc_index::vec::Idx;
|
||||||
|
|
||||||
pub use rustc_mir::monomorphize::collector;
|
pub use rustc_mir::monomorphize::collector;
|
||||||
|
|
||||||
pub use rustc_codegen_ssa::mir::operand::{OperandRef, OperandValue};
|
pub use rustc_codegen_ssa::mir::operand::{OperandRef, OperandValue};
|
||||||
|
@ -225,7 +229,8 @@ impl CodegenBackend for CraneliftCodegenBackend {
|
||||||
.downcast::<CodegenResults>()
|
.downcast::<CodegenResults>()
|
||||||
.expect("Expected CraneliftCodegenBackend's CodegenResult, found Box<Any>");
|
.expect("Expected CraneliftCodegenBackend's CodegenResult, found Box<Any>");
|
||||||
|
|
||||||
sess.profiler(|p| p.start_activity("link_crate"));
|
let _timer = sess.prof.generic_activity("link_crate");
|
||||||
|
|
||||||
rustc::util::common::time(sess, "linking", || {
|
rustc::util::common::time(sess, "linking", || {
|
||||||
let target_cpu = crate::target_triple(sess).to_string();
|
let target_cpu = crate::target_triple(sess).to_string();
|
||||||
link_binary::<crate::archive::ArArchiveBuilder<'_>>(
|
link_binary::<crate::archive::ArArchiveBuilder<'_>>(
|
||||||
|
@ -236,7 +241,6 @@ impl CodegenBackend for CraneliftCodegenBackend {
|
||||||
&target_cpu,
|
&target_cpu,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
sess.profiler(|p| p.end_activity("link_crate"));
|
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue