diff --git a/rust-version b/rust-version index cbd8e33577..e278a80633 100644 --- a/rust-version +++ b/rust-version @@ -1 +1 @@ -24a9bcbb7cb0d8bdc11b8252a9c13f7562c7e4ca +481068a707679257e2a738b40987246e0420e787 diff --git a/src/eval.rs b/src/eval.rs index b29ce35377..6132c50253 100644 --- a/src/eval.rs +++ b/src/eval.rs @@ -1,3 +1,5 @@ +//! Main evaluator loop and setting up the initial stack frame. + use rand::rngs::StdRng; use rand::SeedableRng; @@ -29,23 +31,22 @@ pub fn create_ecx<'mir, 'tcx: 'mir>( main_id: DefId, config: MiriConfig, ) -> InterpResult<'tcx, InterpCx<'mir, 'tcx, Evaluator<'tcx>>> { - let mut ecx = InterpCx::new( - tcx.at(syntax::source_map::DUMMY_SP), - ty::ParamEnv::reveal_all(), - Evaluator::new(), - ); // FIXME(https://github.com/rust-lang/miri/pull/803): no validation on Windows. - let target_os = ecx.tcx.tcx.sess.target.target.target_os.to_lowercase(); + let target_os = tcx.sess.target.target.target_os.to_lowercase(); let validate = if target_os == "windows" { false } else { config.validate }; - // FIXME: InterpCx::new should take an initial MemoryExtra - ecx.memory_mut().extra = MemoryExtra::new(config.seed.map(StdRng::seed_from_u64), 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), + ); + let main_instance = ty::Instance::mono(ecx.tcx.tcx, main_id); let main_mir = ecx.load_mir(main_instance.def)?; diff --git a/src/machine.rs b/src/machine.rs index 930eeee96b..0875331131 100644 --- a/src/machine.rs +++ b/src/machine.rs @@ -1,3 +1,6 @@ +//! Global machine state as well as implementation of the interpreter engine +//! `Machine` trait. + use std::rc::Rc; use std::borrow::Cow; use std::collections::HashMap; @@ -48,7 +51,7 @@ pub struct AllocExtra { } /// Extra global memory data -#[derive(Default, Clone, Debug)] +#[derive(Clone, Debug)] pub struct MemoryExtra { pub stacked_borrows: stacked_borrows::MemoryExtra, pub intptrcast: intptrcast::MemoryExtra, diff --git a/src/range_map.rs b/src/range_map.rs index 16e7e27241..aa9a87887d 100644 --- a/src/range_map.rs +++ b/src/range_map.rs @@ -1,5 +1,3 @@ -#![allow(unused)] - //! Implements a map from integer indices to data. //! Rather than storing data for every index, internally, this maps entire ranges to the data. //! To this end, the APIs all work on ranges, not on individual integers. Ranges are split as @@ -8,7 +6,6 @@ //! via the iteration APIs. use std::ops; -use std::num::NonZeroU64; use rustc::ty::layout::Size; @@ -158,7 +155,7 @@ impl RangeMap { let mut end_idx = first_idx; // when the loop is done, this is the first excluded element. loop { // Compute if `end` is the last element we need to look at. - let done = (self.v[end_idx].range.end >= offset+len); + let done = self.v[end_idx].range.end >= offset+len; // We definitely need to include `end`, so move the index. end_idx += 1; debug_assert!(done || end_idx < self.v.len(), "iter_mut: end-offset {} is out-of-bounds", offset+len); @@ -284,7 +281,7 @@ mod tests { .map(|&t| t).collect::>(), vec![19, 19]); // A NOP `iter_mut` should trigger merging. - for x in map.iter_mut(Size::from_bytes(15), Size::from_bytes(5)) { } + for _ in map.iter_mut(Size::from_bytes(15), Size::from_bytes(5)) { } assert_eq!(map.v.len(), 5); assert_eq!( to_vec(&map, 10, 10), diff --git a/src/shims/tls.rs b/src/shims/tls.rs index 9a22c03bf2..e2f2dab518 100644 --- a/src/shims/tls.rs +++ b/src/shims/tls.rs @@ -1,3 +1,5 @@ +//! Implement thread-local storage. + use std::collections::BTreeMap; use rustc_target::abi::LayoutOf; diff --git a/src/stacked_borrows.rs b/src/stacked_borrows.rs index 5c59066c47..acd1aec5b7 100644 --- a/src/stacked_borrows.rs +++ b/src/stacked_borrows.rs @@ -1,3 +1,6 @@ +//! Implements "Stacked Borrows". See +//! for further information. + use std::cell::RefCell; use std::collections::{HashMap, HashSet}; use std::rc::Rc; diff --git a/tests/run-pass/move-undef-primval.rs b/tests/run-pass/move-undef-primval.rs index 73c33943a6..b8bd869b48 100644 --- a/tests/run-pass/move-undef-primval.rs +++ b/tests/run-pass/move-undef-primval.rs @@ -1,3 +1,5 @@ +#![allow(deprecated)] + struct Foo { _inner: i32, }