diff options
| author | Noah Lev <camelidcamel@gmail.com> | 2021-10-29 19:59:49 -0700 |
|---|---|---|
| committer | Noah Lev <camelidcamel@gmail.com> | 2021-10-30 11:15:21 -0700 |
| commit | 47b0059dba00a9982721f346b46ceca32620700e (patch) | |
| tree | ecd9706942200ffc45b3fd5fa2222836441e2060 | |
| parent | 27d47d93be38911c365b11ad36536e4ed926fc76 (diff) | |
| download | rust-47b0059dba00a9982721f346b46ceca32620700e.tar.gz rust-47b0059dba00a9982721f346b46ceca32620700e.zip | |
rustdoc: Document that `Crate` is always local
| -rw-r--r-- | src/librustdoc/clean/types.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/librustdoc/clean/types.rs b/src/librustdoc/clean/types.rs index 4604315ac69..c0ceb9a09f4 100644 --- a/src/librustdoc/clean/types.rs +++ b/src/librustdoc/clean/types.rs @@ -113,6 +113,7 @@ impl From<DefId> for ItemId { } } +/// The crate currently being documented. #[derive(Clone, Debug)] crate struct Crate { crate name: Symbol, @@ -142,6 +143,8 @@ crate struct ExternalCrate { } impl ExternalCrate { + const LOCAL: Self = Self { crate_num: LOCAL_CRATE }; + #[inline] crate fn def_id(&self) -> DefId { DefId { krate: self.crate_num, index: CRATE_DEF_INDEX } |
