Skip to content

Commit 276335c

Browse files
v0.39.0
Co-authored-by: Boxy <[email protected]>
1 parent a1dd47c commit 276335c

File tree

4 files changed

+38
-6
lines changed

4 files changed

+38
-6
lines changed

Diff for: CHANGELOG.md

+18
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
<a name="v0.39.0"></a>
2+
# [v0.39.0](https://github.com/rust-lang/rustdoc-types/releases/tag/v0.39.0) - 2025-03-24
3+
4+
**Breaking Change**: Change format of `Item::attrs` for `#[repr(..)]` from HIR
5+
debug printing to how they're written in source-code. For example
6+
`#[attr = Repr([ReprC, ReprInt(SignedInt(I8))])])` would now be represented as
7+
`#[repr(C,i8)]` ((rust#138018)[https://github.com/rust-lang/rust/pull/138018]).
8+
9+
This somewhat undoes (v0.36.0)[#v0.36.0].
10+
11+
No changes were made to the schema (i.e. the public api for this crate is
12+
unchanged), but the format version has been bumped, as this may effect consuming
13+
tools regardless.
14+
15+
- Format Version: 43
16+
- Upstream Commit: [`bafdbcadd5e70e4a1a35647002c30efd315621b4`](https://github.com/rust-lang/rust/commit/bafdbcadd5e70e4a1a35647002c30efd315621b4)
17+
- Diff: [v0.38.0...v0.39.0](https://github.com/rust-lang/rustdoc-types/compare/v0.38.0...v0.39.0)
18+
119
<a name="v0.38.0"></a>
220
# [v0.38.0](https://github.com/rust-lang/rustdoc-types/releases/tag/v0.38.0) - 2025-03-16
321

Diff for: COMMIT.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
e3ac1fa81abd321abe193f491ed06c7d388f68fe
1+
bafdbcadd5e70e4a1a35647002c30efd315621b4

Diff for: 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.38.0"
3+
version = "0.39.0"
44
edition = "2018"
55
license = "MIT OR Apache-2.0"
66
description = "Types for rustdoc's json output"

Diff for: src/lib.rs

+18-4
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 = 42;
32+
pub const FORMAT_VERSION: u32 = 43;
3333

3434
/// The root of the emitted JSON blob.
3535
///
@@ -119,9 +119,23 @@ pub struct Item {
119119
pub docs: Option<String>,
120120
/// 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
121121
pub links: HashMap<String, Id>,
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.
122+
/// Attributes on this item.
123+
///
124+
/// Does not include `#[deprecated]` attributes: see the [`Self::deprecation`] field instead.
125+
///
126+
/// Some attributes appear in pretty-printed Rust form, regardless of their formatting
127+
/// in the original source code. For example:
128+
/// - `#[non_exhaustive]` and `#[must_use]` are represented as themselves.
129+
/// - `#[no_mangle]` and `#[export_name]` are also represented as themselves.
130+
/// - `#[repr(C)]` and other reprs also appear as themselves,
131+
/// though potentially with a different order: e.g. `repr(i8, C)` may become `repr(C, i8)`.
132+
/// Multiple repr attributes on the same item may be combined into an equivalent single attr.
133+
///
134+
/// Other attributes may appear debug-printed. For example:
135+
/// - `#[inline]` becomes something similar to `#[attr="Inline(Hint)"]`.
136+
///
137+
/// As an internal implementation detail subject to change, this debug-printing format
138+
/// is currently equivalent to the HIR pretty-printing of parsed attributes.
125139
pub attrs: Vec<String>,
126140
/// Information about the item’s deprecation, if present.
127141
pub deprecation: Option<Deprecation>,

0 commit comments

Comments
 (0)