@@ -1481,7 +1481,9 @@ pub(crate) enum Type {
14811481 ///
14821482 /// This is mostly Rustdoc's version of [`hir::Path`].
14831483 /// It has to be different because Rustdoc's [`PathSegment`] can contain cleaned generics.
1484- Path { path : Path } ,
1484+ Path {
1485+ path : Path ,
1486+ } ,
14851487 /// A `dyn Trait` object: `dyn for<'a> Trait<'a> + Send + 'static`
14861488 DynTrait ( Vec < PolyTrait > , Option < Lifetime > ) ,
14871489 /// A type parameter.
@@ -1498,10 +1500,15 @@ pub(crate) enum Type {
14981500 ///
14991501 /// The `String` field is a stringified version of the array's length parameter.
15001502 Array ( Box < Type > , Box < str > ) ,
1503+ Pat ( Box < Type > , Box < str > ) ,
15011504 /// A raw pointer type: `*const i32`, `*mut i32`
15021505 RawPointer ( Mutability , Box < Type > ) ,
15031506 /// A reference type: `&i32`, `&'a mut Foo`
1504- BorrowedRef { lifetime : Option < Lifetime > , mutability : Mutability , type_ : Box < Type > } ,
1507+ BorrowedRef {
1508+ lifetime : Option < Lifetime > ,
1509+ mutability : Mutability ,
1510+ type_ : Box < Type > ,
1511+ } ,
15051512
15061513 /// A qualified path to an associated item: `<Type as Trait>::Name`
15071514 QPath ( Box < QPathData > ) ,
@@ -1698,6 +1705,7 @@ impl Type {
16981705 BareFunction ( ..) => PrimitiveType :: Fn ,
16991706 Slice ( ..) => PrimitiveType :: Slice ,
17001707 Array ( ..) => PrimitiveType :: Array ,
1708+ Type :: Pat ( ..) => PrimitiveType :: Pat ,
17011709 RawPointer ( ..) => PrimitiveType :: RawPointer ,
17021710 QPath ( box QPathData { ref self_type, .. } ) => return self_type. inner_def_id ( cache) ,
17031711 Generic ( _) | Infer | ImplTrait ( _) => return None ,
@@ -1749,6 +1757,7 @@ pub(crate) enum PrimitiveType {
17491757 Str ,
17501758 Slice ,
17511759 Array ,
1760+ Pat ,
17521761 Tuple ,
17531762 Unit ,
17541763 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