From 6ef7c0886c0e8113b038306878dbbb43a3b49535 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Thu, 15 Aug 2019 11:14:45 +0200 Subject: [PATCH 1/2] deny warnings on CI --- miri | 2 +- travis.sh | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/miri b/miri index 1f46f04c13e..6de2391137a 100755 --- a/miri +++ b/miri @@ -45,7 +45,7 @@ fi # We set the rpath so that Miri finds the private rustc libraries it needs. # We enable debug-assertions to get tracing. # We enable line-only debuginfo for backtraces. -export RUSTFLAGS="-C link-args=-Wl,-rpath,$LIBDIR -C debug-assertions -C debuginfo=1" +export RUSTFLAGS="-C link-args=-Wl,-rpath,$LIBDIR -C debug-assertions -C debuginfo=1 $RUSTC_EXTRA_FLAGS" ## Helper functions diff --git a/travis.sh b/travis.sh index c06dbaee363..6f14be44ef0 100755 --- a/travis.sh +++ b/travis.sh @@ -8,6 +8,7 @@ else FOREIGN_TARGET=i686-unknown-linux-gnu fi export CARGO_EXTRA_FLAGS="--all-features" +export RUSTC_EXTRA_FLAGS="-D warnings" # Prepare echo "Build and install miri" From f9241be73493f9f1e26631a5389b599557ef4f2f Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Thu, 15 Aug 2019 11:24:04 +0200 Subject: [PATCH 2/2] fix warning --- src/eval.rs | 2 +- src/shims/env.rs | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/eval.rs b/src/eval.rs index ae57bcf98b9..39da414de14 100644 --- a/src/eval.rs +++ b/src/eval.rs @@ -40,7 +40,7 @@ pub fn create_ecx<'mir, 'tcx: 'mir>( MemoryExtra::new(StdRng::seed_from_u64(config.seed.unwrap_or(0)), config.validate), ); // Complete initialization. - EnvVars::init(&mut ecx, config.communicate); + EnvVars::init(&mut ecx); // Setup first stack-frame let main_instance = ty::Instance::mono(ecx.tcx.tcx, main_id); diff --git a/src/shims/env.rs b/src/shims/env.rs index c941bf4f50e..eb5722a5a3d 100644 --- a/src/shims/env.rs +++ b/src/shims/env.rs @@ -13,9 +13,8 @@ pub struct EnvVars { impl EnvVars { pub(crate) fn init<'mir, 'tcx>( ecx: &mut InterpCx<'mir, 'tcx, Evaluator<'tcx>>, - communicate: bool, ) { - if communicate { + if ecx.machine.communicate { for (name, value) in std::env::vars() { let value = alloc_env_value(value.as_bytes(), ecx.memory_mut()); ecx.machine.env_vars.map.insert(name.into_bytes(), value);