@@ -1483,7 +1483,9 @@ pub(crate) enum Type {
1483
1483
///
1484
1484
/// This is mostly Rustdoc's version of [`hir::Path`].
1485
1485
/// It has to be different because Rustdoc's [`PathSegment`] can contain cleaned generics.
1486
- Path { path : Path } ,
1486
+ Path {
1487
+ path : Path ,
1488
+ } ,
1487
1489
/// A `dyn Trait` object: `dyn for<'a> Trait<'a> + Send + 'static`
1488
1490
DynTrait ( Vec < PolyTrait > , Option < Lifetime > ) ,
1489
1491
/// A type parameter.
@@ -1500,10 +1502,15 @@ pub(crate) enum Type {
1500
1502
///
1501
1503
/// The `String` field is a stringified version of the array's length parameter.
1502
1504
Array ( Box < Type > , Box < str > ) ,
1505
+ Pat ( Box < Type > , Box < str > ) ,
1503
1506
/// A raw pointer type: `*const i32`, `*mut i32`
1504
1507
RawPointer ( Mutability , Box < Type > ) ,
1505
1508
/// A reference type: `&i32`, `&'a mut Foo`
1506
- BorrowedRef { lifetime : Option < Lifetime > , mutability : Mutability , type_ : Box < Type > } ,
1509
+ BorrowedRef {
1510
+ lifetime : Option < Lifetime > ,
1511
+ mutability : Mutability ,
1512
+ type_ : Box < Type > ,
1513
+ } ,
1507
1514
1508
1515
/// A qualified path to an associated item: `<Type as Trait>::Name`
1509
1516
QPath ( Box < QPathData > ) ,
@@ -1700,6 +1707,7 @@ impl Type {
1700
1707
BareFunction ( ..) => PrimitiveType :: Fn ,
1701
1708
Slice ( ..) => PrimitiveType :: Slice ,
1702
1709
Array ( ..) => PrimitiveType :: Array ,
1710
+ Type :: Pat ( ..) => PrimitiveType :: Pat ,
1703
1711
RawPointer ( ..) => PrimitiveType :: RawPointer ,
1704
1712
QPath ( box QPathData { ref self_type, .. } ) => return self_type. inner_def_id ( cache) ,
1705
1713
Generic ( _) | Infer | ImplTrait ( _) => return None ,
@@ -1753,6 +1761,7 @@ pub(crate) enum PrimitiveType {
1753
1761
Str ,
1754
1762
Slice ,
1755
1763
Array ,
1764
+ Pat ,
1756
1765
Tuple ,
1757
1766
Unit ,
1758
1767
RawPointer ,
@@ -1907,6 +1916,7 @@ impl PrimitiveType {
1907
1916
Bool => sym:: bool,
1908
1917
Char => sym:: char,
1909
1918
Array => sym:: array,
1919
+ Pat => sym:: pat,
1910
1920
Slice => sym:: slice,
1911
1921
Tuple => sym:: tuple,
1912
1922
Unit => sym:: unit,
0 commit comments