Skip to content

Commit 47b0059

Browse files
committed
rustdoc: Document that Crate is always local
1 parent 27d47d9 commit 47b0059

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/librustdoc/clean/types.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ impl From<DefId> for ItemId {
113113
}
114114
}
115115

116+
/// The crate currently being documented.
116117
#[derive(Clone, Debug)]
117118
crate struct Crate {
118119
crate name: Symbol,
@@ -142,6 +143,8 @@ crate struct ExternalCrate {
142143
}
143144

144145
impl ExternalCrate {
146+
const LOCAL: Self = Self { crate_num: LOCAL_CRATE };
147+
145148
#[inline]
146149
crate fn def_id(&self) -> DefId {
147150
DefId { krate: self.crate_num, index: CRATE_DEF_INDEX }

0 commit comments

Comments
 (0)