about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLeón Orell Valerian Liehr <me@fmease.dev>2025-02-05 05:03:05 +0100
committerGitHub <noreply@github.com>2025-02-05 05:03:05 +0100
commit058ed2b637e8261e7528124a60f82401895b83bd (patch)
tree984baa05127ff9bbfcb349eeb1900d88f8874e2c
parent9830837ab34172aa503f3d63eea4271559e48187 (diff)
parent510de59dbd470d9f62a570eb46bfe4bbb10f0988 (diff)
downloadrust-058ed2b637e8261e7528124a60f82401895b83bd.tar.gz
rust-058ed2b637e8261e7528124a60f82401895b83bd.zip
Rollup merge of #136396 - aDotInTheVoid:crate-isnt-package-whyyy, r=GuillaumeGomez
rustdoc-json-types: Document that crate name isn't package name.

This wasn't clear from the docs before: https://rust-lang.zulipchat.com/#narrow/channel/266220-t-rustdoc/topic/.E2.9C.94.20Getting.20external.20crate.20names.20as.20defined. CC `@kpreid`

r? `@GuillaumeGomez`
-rw-r--r--src/rustdoc-json-types/lib.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/rustdoc-json-types/lib.rs b/src/rustdoc-json-types/lib.rs
index e67e17a73cb..a92f3ded774 100644
--- a/src/rustdoc-json-types/lib.rs
+++ b/src/rustdoc-json-types/lib.rs
@@ -61,6 +61,13 @@ pub struct Crate {
 #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
 pub struct ExternalCrate {
     /// The name of the crate.
+    ///
+    /// Note: This is the [*crate* name][crate-name], which may not be the same as the
+    /// [*package* name][package-name]. For example, for <https://crates.io/crates/regex-syntax>,
+    /// this field will be `regex_syntax` (which uses an `_`, not a `-`).
+    ///
+    /// [crate-name]: https://doc.rust-lang.org/stable/cargo/reference/cargo-targets.html#the-name-field
+    /// [package-name]: https://doc.rust-lang.org/stable/cargo/reference/manifest.html#the-name-field
     pub name: String,
     /// The root URL at which the crate's documentation lives.
     pub html_root_url: Option<String>,