Skip to content

Commit 119a483

Browse files
authored
Unrolled build for rust-lang#125130
Rollup merge of rust-lang#125130 - aDotInTheVoid:id-docs, r=GuillaumeGomez rustdoc-json-types: Document `Id` Inspired by finding [someone looking into the internals of an id](rust-lang#91609 (comment)), I realized we only document the fact that these are opaque on [the rfc](https://rust-lang.github.io/rfcs/2963-rustdoc-json.html#id). r? `@GuillaumeGomez`
2 parents 4a78c00 + 504bca9 commit 119a483

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/rustdoc-json-types/lib.rs

+13-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,19 @@ pub enum TypeBindingKind {
188188
Constraint(Vec<GenericBound>),
189189
}
190190

191-
#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
191+
/// An opaque identifier for an item.
192+
///
193+
/// It can be used to lookup in [Crate::index] or [Crate::paths] to resolve it
194+
/// to an [Item].
195+
///
196+
/// Id's are only valid within a single JSON blob. They cannot be used to
197+
/// resolve references between the JSON output's for different crates.
198+
///
199+
/// Rustdoc makes no guarantees about the inner value of Id's. Applications
200+
/// should treat them as opaque keys to lookup items, and avoid attempting
201+
/// to parse them, or otherwise depend on any implementation details.
202+
#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
203+
// FIXME(aDotInTheVoid): Consider making this non-public in rustdoc-types.
192204
pub struct Id(pub String);
193205

194206
#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]

0 commit comments

Comments
 (0)