@@ -9,7 +9,7 @@ use std::path::PathBuf;
9
9
use serde:: { Deserialize , Serialize } ;
10
10
11
11
/// rustdoc format-version.
12
- pub const FORMAT_VERSION : u32 = 12 ;
12
+ pub const FORMAT_VERSION : u32 = 13 ;
13
13
14
14
/// A `Crate` is the root of the emitted JSON blob. It contains all type/documentation information
15
15
/// about the language items in the local crate, as well as info about external items to allow
@@ -346,9 +346,41 @@ pub struct GenericParamDef {
346
346
#[ derive( Clone , Debug , Serialize , Deserialize , PartialEq ) ]
347
347
#[ serde( rename_all = "snake_case" ) ]
348
348
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
+ } ,
352
384
}
353
385
354
386
#[ derive( Clone , Debug , Serialize , Deserialize , PartialEq ) ]
0 commit comments