Do the hard part first

The only bit failing was the module, so change that before removing the
`span` field.
This commit is contained in:
Joshua Nelson 2021-03-24 00:52:52 -04:00
parent a4b6214279
commit b412b46cf7
9 changed files with 33 additions and 20 deletions

View file

@ -281,15 +281,15 @@ impl<'tcx> Context<'tcx> {
/// may happen, for example, with externally inlined items where the source
/// of their crate documentation isn't known.
pub(super) fn src_href(&self, item: &clean::Item) -> Option<String> {
if item.span.is_dummy() {
if item.span().is_dummy() {
return None;
}
let mut root = self.root_path();
let mut path = String::new();
let cnum = item.span.cnum(self.sess());
let cnum = item.span().cnum(self.sess());
// We can safely ignore synthetic `SourceFile`s.
let file = match item.span.filename(self.sess()) {
let file = match item.span().filename(self.sess()) {
FileName::Real(ref path) => path.local_path().to_path_buf(),
_ => return None,
};
@ -323,8 +323,8 @@ impl<'tcx> Context<'tcx> {
(&*symbol, &path)
};
let loline = item.span.lo(self.sess()).line;
let hiline = item.span.hi(self.sess()).line;
let loline = item.span().lo(self.sess()).line;
let hiline = item.span().hi(self.sess()).line;
let lines =
if loline == hiline { loline.to_string() } else { format!("{}-{}", loline, hiline) };
Some(format!(

View file

@ -1013,7 +1013,7 @@ fn item_macro(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, t: &clean::Mac
Some("macro"),
None,
None,
it.span.inner().edition(),
it.span().inner().edition(),
);
});
document(w, cx, it, None)