Skip to content

Commit b712135

Browse files
committed
rustdoc-json-types: Improve docs for HRTB fields
1 parent 343889b commit b712135

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/rustdoc-json-types/lib.rs

+14-1
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,13 @@ pub enum GenericBound {
408408
TraitBound {
409409
#[serde(rename = "trait")]
410410
trait_: Type,
411-
/// Used for HRTBs
411+
/// Used for Higher-Rank Trait Bounds (HRTBs)
412+
/// ```plain
413+
/// where F: for<'a, 'b> Fn(&'a u8, &'b u8)
414+
/// ^^^^^^^^^^^
415+
/// |
416+
/// this part
417+
/// ```
412418
generic_params: Vec<GenericParamDef>,
413419
modifier: TraitBoundModifier,
414420
},
@@ -487,6 +493,13 @@ pub enum Type {
487493
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
488494
pub struct FunctionPointer {
489495
pub decl: FnDecl,
496+
/// Used for Higher-Rank Trait Bounds (HRTBs)
497+
/// ```plain
498+
/// for<'c> fn(val: &'c i32) -> i32
499+
/// ^^^^^^^
500+
/// |
501+
/// this part
502+
/// ```
490503
pub generic_params: Vec<GenericParamDef>,
491504
pub header: Header,
492505
}

0 commit comments

Comments
 (0)