Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 058ed2b

Browse files
authored
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`
2 parents 9830837 + 510de59 commit 058ed2b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

‎src/rustdoc-json-types/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,13 @@ pub struct Crate {
6161
#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
6262
pub struct ExternalCrate {
6363
/// The name of the crate.
64+
///
65+
/// Note: This is the [*crate* name][crate-name], which may not be the same as the
66+
/// [*package* name][package-name]. For example, for <https://crates.io/crates/regex-syntax>,
67+
/// this field will be `regex_syntax` (which uses an `_`, not a `-`).
68+
///
69+
/// [crate-name]: https://doc.rust-lang.org/stable/cargo/reference/cargo-targets.html#the-name-field
70+
/// [package-name]: https://doc.rust-lang.org/stable/cargo/reference/manifest.html#the-name-field
6471
pub name: String,
6572
/// The root URL at which the crate's documentation lives.
6673
pub html_root_url: Option<String>,

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /