Skip to content

Commit e063f41

Browse files
ICH: Cleanup some comments.
1 parent 6b2dfdb commit e063f41

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/librustc_incremental/calculate_svh/svh_visitor.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ pub struct StrictVersionHashVisitor<'a, 'hash: 'a, 'tcx: 'hash> {
4545

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

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

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

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

0 commit comments

Comments
 (0)