Skip to content

Commit 7dce6e8

Browse files
committed
v0.9.0
1 parent 1513dda commit 7dce6e8

File tree

3 files changed

+38
-6
lines changed

3 files changed

+38
-6
lines changed

COMMIT.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
aefc0a223a0022a156be07b18feb45cd07e517e0
1+
aa763fcf421e627455aa1de16df1292c8e1bcb9d

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.8.0"
3+
version = "0.9.0"
44
authors = ["Nixon Enraght-Moony <[email protected]>", "The Rust Project Developers"]
55
edition = "2018"
66
license = "MIT OR Apache-2.0"

src/lib.rs

+36-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use std::path::PathBuf;
99
use serde::{Deserialize, Serialize};
1010

1111
/// rustdoc format-version.
12-
pub const FORMAT_VERSION: u32 = 12;
12+
pub const FORMAT_VERSION: u32 = 13;
1313

1414
/// A `Crate` is the root of the emitted JSON blob. It contains all type/documentation information
1515
/// about the language items in the local crate, as well as info about external items to allow
@@ -346,9 +346,41 @@ pub struct GenericParamDef {
346346
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
347347
#[serde(rename_all = "snake_case")]
348348
pub enum GenericParamDefKind {
349-
Lifetime { outlives: Vec<String> },
350-
Type { bounds: Vec<GenericBound>, default: Option<Type> },
351-
Const { ty: Type, default: Option<String> },
349+
Lifetime {
350+
outlives: Vec<String>,
351+
},
352+
Type {
353+
bounds: Vec<GenericBound>,
354+
default: Option<Type>,
355+
/// This is normally `false`, which means that this generic parameter is
356+
/// declared in the Rust source text.
357+
///
358+
/// If it is `true`, this generic parameter has been introduced by the
359+
/// compiler behind the scenes.
360+
///
361+
/// # Example
362+
///
363+
/// Consider
364+
///
365+
/// ```ignore (pseudo-rust)
366+
/// pub fn f(_: impl Trait) {}
367+
/// ```
368+
///
369+
/// The compiler will transform this behind the scenes to
370+
///
371+
/// ```ignore (pseudo-rust)
372+
/// pub fn f<impl Trait: Trait>(_: impl Trait) {}
373+
/// ```
374+
///
375+
/// In this example, the generic parameter named `impl Trait` (and which
376+
/// is bound by `Trait`) is synthetic, because it was not originally in
377+
/// the Rust source text.
378+
synthetic: bool,
379+
},
380+
Const {
381+
ty: Type,
382+
default: Option<String>,
383+
},
352384
}
353385

354386
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]

0 commit comments

Comments
 (0)