From e7b39e382a71882546528693ea8ed8125580fcde Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Thu, 11 Jul 2019 18:41:53 +0200 Subject: [PATCH 1/2] reenable all tests on Windows --- src/eval.rs | 11 +---------- tests/compiletest.rs | 4 +--- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/src/eval.rs b/src/eval.rs index dbc3282a306f..faa50f914916 100644 --- a/src/eval.rs +++ b/src/eval.rs @@ -31,20 +31,11 @@ pub fn create_ecx<'mir, 'tcx: 'mir>( main_id: DefId, config: MiriConfig, ) -> InterpResult<'tcx, InterpCx<'mir, 'tcx, Evaluator<'tcx>>> { - - // FIXME(https://github.com/rust-lang/miri/pull/803): no validation on Windows. - let target_os = tcx.sess.target.target.target_os.to_lowercase(); - let validate = if target_os == "windows" { - false - } else { - config.validate - }; - let mut ecx = InterpCx::new( tcx.at(syntax::source_map::DUMMY_SP), ty::ParamEnv::reveal_all(), Evaluator::new(), - MemoryExtra::new(config.seed.map(StdRng::seed_from_u64), validate), + MemoryExtra::new(config.seed.map(StdRng::seed_from_u64), config.validate), ); let main_instance = ty::Instance::mono(ecx.tcx.tcx, main_id); diff --git a/tests/compiletest.rs b/tests/compiletest.rs index 4d799cdb542d..302c080a52eb 100644 --- a/tests/compiletest.rs +++ b/tests/compiletest.rs @@ -111,9 +111,7 @@ fn run_pass_miri(opt: bool) { } fn compile_fail_miri(opt: bool) { - if !cfg!(windows) { // FIXME re-enable on Windows - compile_fail("tests/compile-fail", &get_target(), opt); - } + compile_fail("tests/compile-fail", &get_target(), opt); } fn test_runner(_tests: &[&()]) { From f8c6eb5e8c98d1ff623361d287c6e5af1943ba65 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Thu, 11 Jul 2019 18:59:11 +0200 Subject: [PATCH 2/2] thread creation error for Windows --- src/shims/foreign_items.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shims/foreign_items.rs b/src/shims/foreign_items.rs index fd46eaea9dab..f7c6465a6363 100644 --- a/src/shims/foreign_items.rs +++ b/src/shims/foreign_items.rs @@ -725,8 +725,8 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx this.write_null(dest)?; } - // We don't support threading. - "pthread_create" => { + // We don't support threading. (Also for Windows.) + "pthread_create" | "CreateThread" => { return err!(Unimplemented(format!("Miri does not support threading"))); }