Skip to content

Commit

Permalink
ICH: Cleanup some comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelwoerister committed Sep 1, 2016
1 parent 6785256 commit 500ab35
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/librustc_incremental/calculate_svh/svh_visitor.rs
Expand Up @@ -45,7 +45,7 @@ pub struct StrictVersionHashVisitor<'a, 'hash: 'a, 'tcx: 'hash> {

struct CachingCodemapView<'tcx> {
codemap: &'tcx CodeMap,
// Format: (line number, line-start, line_end, file)
// Format: (line number, line-start, line-end, file)
line_cache: [(usize, BytePos, BytePos, Rc<FileMap>); 4],
eviction_index: usize,
}
Expand Down Expand Up @@ -100,7 +100,7 @@ impl<'tcx> CachingCodemapView<'tcx> {
let line_index = file.lookup_line(pos).unwrap();
let (line_start, line_end) = file.line_bounds(line_index);

// Just overwrite some cache entry. If we got this for, all of them
// Just overwrite some cache entry. If we got this far, all of them
// point to the wrong file.
self.line_cache[self.eviction_index] = (line_index + 1,
line_start,
Expand Down Expand Up @@ -131,11 +131,11 @@ impl<'a, 'hash, 'tcx> StrictVersionHashVisitor<'a, 'hash, 'tcx> {
self.def_path_hashes.hash(def_id)
}

// Hash a span in a stable way. If we would just hash the spans BytePos
// fields that would be similar hashing pointers since those or just offsets
// into the CodeMap. Instead, we hash the (file name, line, column) triple,
// which stays the same even if the containing FileMap has moved within the
// CodeMap.
// Hash a span in a stable way. We can't directly hash the span's BytePos
// fields (that would be similar to hashing pointers, since those are just
// offsets into the CodeMap). Instead, we hash the (file name, line, column)
// triple, which stays the same even if the containing FileMap has moved
// within the CodeMap.
// Also note that we are hashing byte offsets for the column, not unicode
// codepoint offsets. For the purpose of the hash that's sufficient.
fn hash_span(&mut self, span: Span) {
Expand Down Expand Up @@ -462,7 +462,6 @@ impl<'a, 'hash, 'tcx> visit::Visitor<'tcx> for StrictVersionHashVisitor<'a, 'has
fn visit_generics(&mut self, g: &'tcx Generics) {
debug!("visit_generics: st={:?}", self.st);
SawGenerics.hash(self.st);
// FIXME: nested stuff
visit::walk_generics(self, g)
}

Expand Down Expand Up @@ -605,7 +604,8 @@ impl<'a, 'hash, 'tcx> visit::Visitor<'tcx> for StrictVersionHashVisitor<'a, 'has
SawMacroDef.hash(self.st);
hash_attrs!(self, &macro_def.attrs);
visit::walk_macro_def(self, macro_def)
// FIXME: We should hash the body of the macro too.
// FIXME(mw): We should hash the body of the macro too but we don't
// have a stable way of doing so yet.
}
}
}
Expand Down

0 comments on commit 500ab35

Please sign in to comment.