diff options
Diffstat (limited to 'src/librustdoc/html/sources.rs')
| -rw-r--r-- | src/librustdoc/html/sources.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/librustdoc/html/sources.rs b/src/librustdoc/html/sources.rs index 79e7d3d783b..c5f44baced2 100644 --- a/src/librustdoc/html/sources.rs +++ b/src/librustdoc/html/sources.rs @@ -5,6 +5,7 @@ use crate::html::format::Buffer; use crate::html::highlight; use crate::html::layout; use crate::html::render::{Error, SharedContext, BASIC_KEYWORDS}; +use rustc_hir::def_id::LOCAL_CRATE; use rustc_span::source_map::FileName; use std::ffi::OsStr; use std::fs; @@ -35,10 +36,10 @@ impl<'a> DocFolder for SourceCollector<'a> { // If we're including source files, and we haven't seen this file yet, // then we need to render it out to the filesystem. if self.scx.include_sources - // skip all invalid or macro spans + // skip all synthetic "files" && item.source.filename.is_real() - // skip non-local items - && item.def_id.is_local() + // skip non-local files + && item.source.cnum == LOCAL_CRATE { // 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 |
