Skip to content

Commit ace5ad2

Browse files
v0.36.0
Co-authored-by: Martin Nordholts <[email protected]>
1 parent 19fa5e4 commit ace5ad2

File tree

4 files changed

+32
-4
lines changed

4 files changed

+32
-4
lines changed

CHANGELOG.md

+19
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
<a name="v0.36.0"></a>
2+
# [v0.36.0](https://github.com/rust-lang/rustdoc-types/releases/tag/v0.36.0) - 2025-02-26
3+
4+
**Breaking Change**: Change format of `Item::attrs` from e.g. `"#[inline]"` to
5+
e.g. `#[attr="Inline(Hint)"]` which is equivalent to the hir pretty-printing of
6+
attributes ([rust#135726](https://github.com/rust-lang/rust/pull/135726)).
7+
8+
This is result of a refractoring of how rustc represents attributes. There will
9+
be a change (at some point) to make them easer to use in rustdoc-json. See
10+
[rust#137645](https://github.com/rust-lang/rust/issues/137645) for details.
11+
12+
No changes were made to the schema (i.e. the public api for this crate is
13+
unchanged), but the format version has been bumped, as this may effect consuming
14+
tools regardless.
15+
16+
- Format Version: 40
17+
- Upstream Commit: [`f321f107e3af37996ac6cca74294d581f2fb20e7`](https://github.com/rust-lang/rust/commit/f321f107e3af37996ac6cca74294d581f2fb20e7)
18+
- Diff: [v0.35.0...v0.36.0](https://github.com/rust-lang/rustdoc-types/compare/v0.35.0...v0.36.0)
19+
120
<a name="v0.35.0"></a>
221
# [v0.35.0](https://github.com/rust-lang/rustdoc-types/releases/tag/v0.35.0) - 2025-01-24
322

COMMIT.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
40e28582bb95e33f762dea75b78f6ebb5c29b836
1+
f321f107e3af37996ac6cca74294d581f2fb20e7

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rustdoc-types"
3-
version = "0.35.0"
3+
version = "0.36.0"
44
edition = "2018"
55
license = "MIT OR Apache-2.0"
66
description = "Types for rustdoc's json output"

src/lib.rs

+11-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ use serde::{Deserialize, Serialize};
2929
/// This integer is incremented with every breaking change to the API,
3030
/// and is returned along with the JSON blob as [`Crate::format_version`].
3131
/// Consuming code should assert that this value matches the format version(s) that it supports.
32-
pub const FORMAT_VERSION: u32 = 39;
32+
pub const FORMAT_VERSION: u32 = 40;
3333

3434
/// The root of the emitted JSON blob.
3535
///
@@ -60,6 +60,13 @@ pub struct Crate {
6060
#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
6161
pub struct ExternalCrate {
6262
/// The name of the crate.
63+
///
64+
/// Note: This is the [*crate* name][crate-name], which may not be the same as the
65+
/// [*package* name][package-name]. For example, for <https://crates.io/crates/regex-syntax>,
66+
/// this field will be `regex_syntax` (which uses an `_`, not a `-`).
67+
///
68+
/// [crate-name]: https://doc.rust-lang.org/stable/cargo/reference/cargo-targets.html#the-name-field
69+
/// [package-name]: https://doc.rust-lang.org/stable/cargo/reference/manifest.html#the-name-field
6370
pub name: String,
6471
/// The root URL at which the crate's documentation lives.
6572
pub html_root_url: Option<String>,
@@ -112,7 +119,9 @@ pub struct Item {
112119
pub docs: Option<String>,
113120
/// This mapping resolves [intra-doc links](https://github.com/rust-lang/rfcs/blob/master/text/1946-intra-rustdoc-links.md) from the docstring to their IDs
114121
pub links: HashMap<String, Id>,
115-
/// Stringified versions of the attributes on this item (e.g. `"#[inline]"`)
122+
/// Stringified versions of parsed attributes on this item.
123+
/// Essentially debug printed (e.g. `#[inline]` becomes something similar to `#[attr="Inline(Hint)"]`).
124+
/// Equivalent to the hir pretty-printing of attributes.
116125
pub attrs: Vec<String>,
117126
/// Information about the item’s deprecation, if present.
118127
pub deprecation: Option<Deprecation>,

0 commit comments

Comments
 (0)