use serde::{Deserialize, Serialize};
/// rustdoc format-version.
-pub const FORMAT_VERSION: u32 = 14;
+pub const FORMAT_VERSION: u32 = 15;
/// A `Crate` is the root of the emitted JSON blob. It contains all type/documentation information
/// about the language items in the local crate, as well as info about external items to allow
#[serde(rename = "type")]
type_: Type,
bounds: Vec<GenericBound>,
+ /// Used for Higher-Rank Trait Bounds (HRTBs)
+ /// ```plain
+ /// where for<'a> &'a T: Iterator,"
+ /// ^^^^^^^
+ /// |
+ /// this part
+ /// ```
+ generic_params: Vec<GenericParamDef>,
},
RegionPredicate {
lifetime: String,
TraitBound {
#[serde(rename = "trait")]
trait_: Type,
- /// Used for HRTBs
+ /// Used for Higher-Rank Trait Bounds (HRTBs)
+ /// ```plain
+ /// where F: for<'a, 'b> Fn(&'a u8, &'b u8)
+ /// ^^^^^^^^^^^
+ /// |
+ /// this part
+ /// ```
generic_params: Vec<GenericParamDef>,
modifier: TraitBoundModifier,
},
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
pub struct FunctionPointer {
pub decl: FnDecl,
+ /// Used for Higher-Rank Trait Bounds (HRTBs)
+ /// ```plain
+ /// for<'c> fn(val: &'c i32) -> i32
+ /// ^^^^^^^
+ /// |
+ /// this part
+ /// ```
pub generic_params: Vec<GenericParamDef>,
pub header: Header,
}