Make fields of Span private

This commit is contained in:
Vadim Petrochenkov 2017-07-31 23:04:34 +03:00
parent 630e02f25b
commit 3da868dcb6
60 changed files with 316 additions and 349 deletions

View file

@ -457,8 +457,8 @@ impl Clean<Item> for doctree::Module {
// the outer `mod` item for the source code.
let whence = {
let cm = cx.sess().codemap();
let outer = cm.lookup_char_pos(self.where_outer.lo);
let inner = cm.lookup_char_pos(self.where_inner.lo);
let outer = cm.lookup_char_pos(self.where_outer.lo());
let inner = cm.lookup_char_pos(self.where_inner.lo());
if outer.file.start_pos == inner.file.start_pos {
// mod foo { ... }
self.where_outer
@ -2251,8 +2251,8 @@ impl Clean<Span> for syntax_pos::Span {
let cm = cx.sess().codemap();
let filename = cm.span_to_filename(*self);
let lo = cm.lookup_char_pos(self.lo);
let hi = cm.lookup_char_pos(self.hi);
let lo = cm.lookup_char_pos(self.lo());
let hi = cm.lookup_char_pos(self.hi());
Span {
filename: filename.to_string(),
loline: lo.line,

View file

@ -532,7 +532,7 @@ impl Collector {
pub fn get_line(&self) -> usize {
if let Some(ref codemap) = self.codemap {
let line = self.position.lo.to_usize();
let line = self.position.lo().to_usize();
let line = codemap.lookup_char_pos(BytePos(line as u32)).line;
if line > 0 { line - 1 } else { line }
} else {