@@ -1475,7 +1475,9 @@ pub(crate) enum Type {
14751475 ///
14761476 /// This is mostly Rustdoc's version of [`hir::Path`].
14771477 /// It has to be different because Rustdoc's [`PathSegment`] can contain cleaned generics.
1478- Path { path : Path } ,
1478+ Path {
1479+ path : Path ,
1480+ } ,
14791481 /// A `dyn Trait` object: `dyn for<'a> Trait<'a> + Send + 'static`
14801482 DynTrait ( Vec < PolyTrait > , Option < Lifetime > ) ,
14811483 /// A type parameter.
@@ -1492,10 +1494,15 @@ pub(crate) enum Type {
14921494 ///
14931495 /// The `String` field is a stringified version of the array's length parameter.
14941496 Array ( Box < Type > , Box < str > ) ,
1497+ Pat ( Box < Type > , Box < str > ) ,
14951498 /// A raw pointer type: `*const i32`, `*mut i32`
14961499 RawPointer ( Mutability , Box < Type > ) ,
14971500 /// A reference type: `&i32`, `&'a mut Foo`
1498- BorrowedRef { lifetime : Option < Lifetime > , mutability : Mutability , type_ : Box < Type > } ,
1501+ BorrowedRef {
1502+ lifetime : Option < Lifetime > ,
1503+ mutability : Mutability ,
1504+ type_ : Box < Type > ,
1505+ } ,
14991506
15001507 /// A qualified path to an associated item: `<Type as Trait>::Name`
15011508 QPath ( Box < QPathData > ) ,
@@ -1692,6 +1699,7 @@ impl Type {
16921699 BareFunction ( ..) => PrimitiveType :: Fn ,
16931700 Slice ( ..) => PrimitiveType :: Slice ,
16941701 Array ( ..) => PrimitiveType :: Array ,
1702+ Type :: Pat ( ..) => PrimitiveType :: Pat ,
16951703 RawPointer ( ..) => PrimitiveType :: RawPointer ,
16961704 QPath ( box QPathData { ref self_type, .. } ) => return self_type. inner_def_id ( cache) ,
16971705 Generic ( _) | Infer | ImplTrait ( _) => return None ,
@@ -1745,6 +1753,7 @@ pub(crate) enum PrimitiveType {
17451753 Str ,
17461754 Slice ,
17471755 Array ,
1756+ Pat ,
17481757 Tuple ,
17491758 Unit ,
17501759 RawPointer ,
@@ -1895,6 +1904,7 @@ impl PrimitiveType {
18951904 Bool => sym:: bool,
18961905 Char => sym:: char,
18971906 Array => sym:: array,
1907+ Pat => sym:: pat,
18981908 Slice => sym:: slice,
18991909 Tuple => sym:: tuple,
19001910 Unit => sym:: unit,
0 commit comments