diff options
| author | Joshua Nelson <jyn514@gmail.com> | 2021-03-24 00:52:52 -0400 |
|---|---|---|
| committer | Joshua Nelson <jyn514@gmail.com> | 2021-04-24 19:20:46 -0400 |
| commit | b412b46cf70de4e08cda3ac120ebfa349c1bc268 (patch) | |
| tree | 084321fcb8806af60a207fc6efc368372b1ce45f /src/librustdoc/html | |
| parent | a4b62142799095a6426db6d873d1de173d20c445 (diff) | |
| download | rust-b412b46cf70de4e08cda3ac120ebfa349c1bc268.tar.gz rust-b412b46cf70de4e08cda3ac120ebfa349c1bc268.zip | |
Do the hard part first
The only bit failing was the module, so change that before removing the `span` field.
Diffstat (limited to 'src/librustdoc/html')
| -rw-r--r-- | src/librustdoc/html/render/context.rs | 10 | ||||
| -rw-r--r-- | src/librustdoc/html/render/print_item.rs | 2 | ||||
| -rw-r--r-- | src/librustdoc/html/sources.rs | 6 |
3 files changed, 9 insertions, 9 deletions
diff --git a/src/librustdoc/html/render/context.rs b/src/librustdoc/html/render/context.rs index 9cffcef9749..089167a6673 100644 --- a/src/librustdoc/html/render/context.rs +++ b/src/librustdoc/html/render/context.rs @@ -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!( diff --git a/src/librustdoc/html/render/print_item.rs b/src/librustdoc/html/render/print_item.rs index 5865da9440b..0fc1c7d60e7 100644 --- a/src/librustdoc/html/render/print_item.rs +++ b/src/librustdoc/html/render/print_item.rs @@ -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) diff --git a/src/librustdoc/html/sources.rs b/src/librustdoc/html/sources.rs index 5a2a165191a..a22ff11b416 100644 --- a/src/librustdoc/html/sources.rs +++ b/src/librustdoc/html/sources.rs @@ -41,11 +41,11 @@ impl DocFolder for SourceCollector<'_, '_> { // then we need to render it out to the filesystem. if self.scx.include_sources // skip all synthetic "files" - && item.span.filename(self.sess()).is_real() + && item.span().filename(self.sess()).is_real() // skip non-local files - && item.span.cnum(self.sess()) == LOCAL_CRATE + && item.span().cnum(self.sess()) == LOCAL_CRATE { - let filename = item.span.filename(self.sess()); + let filename = item.span().filename(self.sess()); // If it turns out that we couldn't read this file, then we probably // can't read any of the files (generating html output from json or // something like that), so just don't include sources for the |
