Skip to content

Commit aa5a9bc

Browse files
committed
some module comments
1 parent 857305f commit aa5a9bc

File tree

5 files changed

+11
-4
lines changed

5 files changed

+11
-4
lines changed

src/eval.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Main evaluator loop and setting up the initial stack frame.
2+
13
use rand::rngs::StdRng;
24
use rand::SeedableRng;
35

src/machine.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
//! Global machine state as well as implementation of the interpreter engine
2+
//! `Machine` trait.
3+
14
use std::rc::Rc;
25
use std::borrow::Cow;
36
use std::collections::HashMap;

src/range_map.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![allow(unused)]
2-
31
//! Implements a map from integer indices to data.
42
//! Rather than storing data for every index, internally, this maps entire ranges to the data.
53
//! To this end, the APIs all work on ranges, not on individual integers. Ranges are split as
@@ -8,7 +6,6 @@
86
//! via the iteration APIs.
97
108
use std::ops;
11-
use std::num::NonZeroU64;
129

1310
use rustc::ty::layout::Size;
1411

@@ -158,7 +155,7 @@ impl<T> RangeMap<T> {
158155
let mut end_idx = first_idx; // when the loop is done, this is the first excluded element.
159156
loop {
160157
// Compute if `end` is the last element we need to look at.
161-
let done = (self.v[end_idx].range.end >= offset+len);
158+
let done = self.v[end_idx].range.end >= offset+len;
162159
// We definitely need to include `end`, so move the index.
163160
end_idx += 1;
164161
debug_assert!(done || end_idx < self.v.len(), "iter_mut: end-offset {} is out-of-bounds", offset+len);

src/stacked_borrows.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
//! Implements "Stacked Borrows". See <https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md>
2+
//! for further information.
3+
14
use std::cell::RefCell;
25
use std::collections::{HashMap, HashSet};
36
use std::rc::Rc;

src/tls.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Implement thread-local storage.
2+
13
use std::collections::BTreeMap;
24

35
use rustc_target::abi::LayoutOf;

0 commit comments

Comments
 (0)