Skip to content

Commit

Permalink
some module comments
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Jun 29, 2019
1 parent 857305f commit 602201c
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/eval.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! Main evaluator loop and setting up the initial stack frame.
use rand::rngs::StdRng;
use rand::SeedableRng;

Expand Down
3 changes: 3 additions & 0 deletions src/machine.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
5 changes: 1 addition & 4 deletions src/range_map.rs
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -8,7 +6,6 @@
//! via the iteration APIs.
use std::ops;
use std::num::NonZeroU64;

use rustc::ty::layout::Size;

Expand Down Expand Up @@ -158,7 +155,7 @@ impl<T> RangeMap<T> {
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);
Expand Down
3 changes: 3 additions & 0 deletions src/stacked_borrows.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//! Implements "Stacked Borrows". See <https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md>
//! for further information.
use std::cell::RefCell;
use std::collections::{HashMap, HashSet};
use std::rc::Rc;
Expand Down
2 changes: 2 additions & 0 deletions src/tls.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! Implement thread-local storage.
use std::collections::BTreeMap;

use rustc_target::abi::LayoutOf;
Expand Down

0 comments on commit 602201c

Please sign in to comment.