diff --git a/src/eval.rs b/src/eval.rs index fd5404a981d2..616e11a51561 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; diff --git a/src/machine.rs b/src/machine.rs index 8ef5410f395f..9785d6a45560 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; diff --git a/src/range_map.rs b/src/range_map.rs index 16e7e2724179..f2cbd89f64da 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); diff --git a/src/stacked_borrows.rs b/src/stacked_borrows.rs index 524ad2b47af0..6e5bbf50941b 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/src/tls.rs b/src/tls.rs index ddc301447c7e..73c778f66d25 100644 --- a/src/tls.rs +++ b/src/tls.rs @@ -1,3 +1,5 @@ +//! Implement thread-local storage. + use std::collections::BTreeMap; use rustc_target::abi::LayoutOf;